Skip to content

Instantly share code, notes, and snippets.

@lifeeth
Created February 11, 2012 06:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lifeeth/1796893 to your computer and use it in GitHub Desktop.
Save lifeeth/1796893 to your computer and use it in GitHub Desktop.
Scheduler process spawning for Web2py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
# Note the app name is hardcoded!
APPLICATION = 'eden'
if '__file__' in globals():
path = os.path.dirname(os.path.abspath(__file__))
os.chdir(path)
else:
path = os.getcwd() # Seems necessary for py2exe
sys.path = [path]+[p for p in sys.path if not p==path]
import gluon.widget
from gluon.shell import run
# Start Web2py Scheduler
if __name__ == '__main__':
run(APPLICATION,True,True,None,False,"from gluon import current; current._scheduler.loop()")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment