Sfoglia il codice sorgente

Style fixes

master
Chris Smith 14 anni fa
parent
commit
e987eb0a23
2 ha cambiato i file con 6 aggiunte e 5 eliminazioni
  1. 4
    3
      src/Scraper.py
  2. 2
    2
      src/helloworld.py

+ 4
- 3
src/Scraper.py Vedi File

2
 from datetime import datetime
2
 from datetime import datetime
3
 import urllib2
3
 import urllib2
4
 
4
 
5
-class scraper:
5
+class Scraper:
6
 
6
 
7
-    def scrape_spore(self, credentials):
7
+    @staticmethod
8
+    def scrape_spore(credentials):
8
         results = []
9
         results = []
9
         url = "http://www.spore.com/view/achievements/%s" % credentials
10
         url = "http://www.spore.com/view/achievements/%s" % credentials
10
         fmt = "%a %B %d, %Y"
11
         fmt = "%a %B %d, %Y"
22
         except urllib2.URLError, e:
23
         except urllib2.URLError, e:
23
           handleError(e)
24
           handleError(e)
24
 
25
 
25
-        return results
26
+        return results

+ 2
- 2
src/helloworld.py Vedi File

1
 import cgi
1
 import cgi
2
-from Scraper import scraper
2
+from Scraper import Scraper
3
 import os
3
 import os
4
 from google.appengine.ext.webapp import template
4
 from google.appengine.ext.webapp import template
5
 
5
 
105
         res = []
105
         res = []
106
 
106
 
107
         if account.source.name == 'Spore':
107
         if account.source.name == 'Spore':
108
-            res = scraper().scrape_spore(account.credentials)
108
+            res = Scraper.scrape_spore(account.credentials)
109
 
109
 
110
         UpdatePage.merge_achievements(account, res)
110
         UpdatePage.merge_achievements(account, res)
111
 
111
 

Loading…
Annulla
Salva