doc fixes

This commit is contained in:
niphlod
2014-08-21 22:49:26 +02:00
parent b18dda1f53
commit 7e73faf619
2 changed files with 9 additions and 2 deletions
+6 -1
View File
@@ -169,9 +169,14 @@ class JobGraph(object):
self.db = db
def add_deps(self, task_parent, task_child):
"""Creates a dependency between task_parent and task_child"""
self.db.scheduler_task_deps.insert(task_parent=task_parent, task_child=task_child, job_name=self.job_name)
def validate(self, job_name):
"""Validates if all tasks job_name can be completed, i.e. there
are no mutual dependencies among tasks.
Commits at the end if successfull, or it rollbacks the entire
transaction. Handle with care!"""
db = self.db
sd = db.scheduler_task_deps
if job_name:
@@ -1380,7 +1385,7 @@ class Scheduler(MetaScheduler):
return rtn
def get_workers(self, only_ticker=False):
""" Returns a dict holding worker_name : {**columns}
""" Returns a dict holding `worker_name : {**columns}`
representing all "registered" workers
only_ticker returns only the workers running as a TICKER,
if there are any
+3 -1
View File
@@ -4425,8 +4425,10 @@ def geocode(address):
return (0.0, 0.0)
def reverse_geocode(lat, lng, lang=current.T.accepted_language):
def reverse_geocode(lat, lng, lang=None):
""" Try to get an approximate address for a given latitude, longitude. """
if not lang:
lang = current.T.accepted_language
try:
return json_parser.loads(fetch('http://maps.googleapis.com/maps/api/geocode/json?latlng=%(lat)s,%(lng)s&language=%(lang)s' % locals()))['results'][0]['formatted_address']
except: