zoom.sites module¶
zoom.sites
Updated Zoom sites module. Eventually, the functionality currently in zoom.site will make it’s way here.
Note: experimental
-
class
zoom.sites.BackgroundJob(name, path)¶ Bases:
objectBackground Job
-
class
zoom.sites.Site(path=None)¶ Bases:
zoom.site.Sitea Zoom site
A zoom site can be completely determined by the path to the site directory. That directory may contain a config file, apps, and other assets. If any assets are required that are not found in the site directory, the system will look in the default site as a fallback. Any site setttings not found in the site config file will be obtained from the default site. Any settings not found there will rely on built-in defaults.
This Site object is not to be confused with the zoom.site.Site object, renamed here as BasicSite, which will eventually be phased out as that functionality is brought into this module.
>>> site = Site() >>> site.name 'localhost'
>>> 'users' in site.db.get_tables() True
-
get_background_jobs()¶ Returns a dict of background jobs
>>> site = Site() >>> site.name 'localhost' >>> site.get_background_jobs() [BackgroundJob('hello')]
-
-
class
zoom.sites.SiteProxy(path)¶ Bases:
objectSite proxy
-
run_background_jobs()¶ Run background jobs
Iterates through the apps in the site and calls run_background_jobs on each one.
>>> import zoom >>> site_directory = zoom.tools.zoompath('web/sites/localhost') >>> site = SiteProxy(site_directory) >>> site.run_background_jobs() localhost
-