Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes
googleimport.driver.Collector Class Reference

List of all members.

Public Member Functions

def is_gatherer
def __init__
def collect_tasks
def easytodo_pages
def moin_bugs
def translation_items

Public Attributes

 url
 server

Detailed Description

Definition at line 107 of file driver.py.


Constructor & Destructor Documentation

def googleimport.driver.Collector.__init__ (   self,
  url 
)

Definition at line 112 of file driver.py.

00112 
00113     def __init__(self, url):
00114         self.url = url
00115         self.server = xmlrpclib.ServerProxy(url + "?action=xmlrpc2")


Member Function Documentation

Definition at line 116 of file driver.py.

00116 
00117     def collect_tasks(self):
00118         tasks = []
00119         for gatherer in gatherers:
00120             new = list(gatherer(self))
00121             tasks.extend(new)
00122 
00123         return tasks

Definition at line 125 of file driver.py.

00125 
00126     def easytodo_pages(self):
00127         pages = self.server.getAllPagesEx(dict(prefix="EasyToDo/"))
00128         for page in pages:
00129             if page in already_pushed_pages:
00130                 continue
00131             page_contents = self.server.getPage(page)
00132             try:
00133                 summary = find_dict_entry("Summary", page_contents)
00134                 count = int(find_dict_entry("Count", page_contents))
00135                 label = find_dict_entry("Label", page_contents)
00136             except DataNotFoundException, e:
00137                 print "Could not import %r because of %r" % (page, e)
00138                 continue
00139             desc_m = re.search(desc_pattern, page_contents)
00140             if not desc_m:
00141                 raise Exception("Desc not found")
00142             desc = desc_m.groups()[0]
00143             for i in range(1, count + 1):
00144                 print page
00145                 text = desc
00146                 new_summary = summary
00147                 text += "\n\nA more detailed description of this issue is available at the MoinMoin wiki: %s" % (self.url + quote(page.encode("utf-8")), )
00148                 if count > 1:
00149                     text += "\n\nThis issue is available multiple times. This one is %i of %i." % (i, count)
00150                     new_summary += " %i/%i" % (i, count)
00151                 yield Task(new_summary, text, label)

Here is the call graph for this function:

Definition at line 108 of file driver.py.

00108 
00109     def is_gatherer(function):
00110         gatherers.append(function)
00111         return function

Definition at line 153 of file driver.py.

00153 
00154     def moin_bugs(self):
00155         pages = [pagename for pagename, contents in self.server.searchPages(r"t:MoinMoinBugs/ r:CategoryEasy\b")]
00156         for page in pages:
00157             bug_name = page.replace("MoinMoinBugs/", "")
00158             if bug_name in already_pushed_bugs:
00159                 continue
00160             page_contents = self.server.getPage(page)
00161             m = re.search(bugpage_pattern, page_contents)
00162             if not m:
00163                 raise Exception("bug desc not found")
00164             desc = m.groups()[0]
00165             desc = "A user filed a bug report at the MoinMoin site. Here is a short description about the issue. A more detailed description is available at the MoinMoin wiki: %s\n\n" % (self.url + quote(page.encode("utf-8")), ) + desc
00166             yield Task(bug_name, desc, "Code")

Definition at line 168 of file driver.py.

00168 
00169     def translation_items(self):
00170         #languages = self.server.getPage(u"EasyToDoTranslation/Languages").strip().splitlines()
00171         #languages = ["Lithuanian (lt)"]
00172         languages = []
00173         for language in languages:
00174             page = u"EasyToDoTranslation"
00175             page_contents = self.server.getPage(page)
00176             page_contents = page_contents.replace("LANG", language)
00177             summary = find_dict_entry("Summary", page_contents)
00178             count = int(find_dict_entry("Count", page_contents))
00179             desc_m = re.search(desc_pattern, page_contents)
00180             if not desc_m:
00181                 raise Exception("Desc not found")
00182             desc = desc_m.groups()[0]
00183             for i in range(1, count + 1):
00184                 text = desc
00185                 new_summary = summary
00186                 text += "\n\nA more detailed description of this task is available at the MoinMoin wiki: %s" % (self.url + quote(page.encode("utf-8")), )
00187                 if count > 1:
00188                     text += "\n\nThis task is available multiple times. This one is %i of %i." % (i, count)
00189                     new_summary += " %i/%i" % (i, count)
00190                 yield Task(new_summary, text, "Translation")
00191 

Here is the call graph for this function:


Member Data Documentation

Definition at line 114 of file driver.py.

Definition at line 113 of file driver.py.


The documentation for this class was generated from the following file: