doc fixes
This commit is contained in:
+6
-1
@@ -169,9 +169,14 @@ class JobGraph(object):
|
|||||||
self.db = db
|
self.db = db
|
||||||
|
|
||||||
def add_deps(self, task_parent, task_child):
|
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)
|
self.db.scheduler_task_deps.insert(task_parent=task_parent, task_child=task_child, job_name=self.job_name)
|
||||||
|
|
||||||
def validate(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
|
db = self.db
|
||||||
sd = db.scheduler_task_deps
|
sd = db.scheduler_task_deps
|
||||||
if job_name:
|
if job_name:
|
||||||
@@ -1380,7 +1385,7 @@ class Scheduler(MetaScheduler):
|
|||||||
return rtn
|
return rtn
|
||||||
|
|
||||||
def get_workers(self, only_ticker=False):
|
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
|
representing all "registered" workers
|
||||||
only_ticker returns only the workers running as a TICKER,
|
only_ticker returns only the workers running as a TICKER,
|
||||||
if there are any
|
if there are any
|
||||||
|
|||||||
+3
-1
@@ -4425,8 +4425,10 @@ def geocode(address):
|
|||||||
return (0.0, 0.0)
|
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. """
|
""" Try to get an approximate address for a given latitude, longitude. """
|
||||||
|
if not lang:
|
||||||
|
lang = current.T.accepted_language
|
||||||
try:
|
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']
|
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:
|
except:
|
||||||
|
|||||||
Reference in New Issue
Block a user