| | 136 | ## Add scheduler config |
| | 137 | |
| | 138 | cat << EOF > "/home/web2py/run_scheduler.py" |
| | 139 | #!/usr/bin/env python |
| | 140 | # -*- coding: utf-8 -*- |
| | 141 | |
| | 142 | import os |
| | 143 | import sys |
| | 144 | |
| | 145 | if '__file__' in globals(): |
| | 146 | path = os.path.dirname(os.path.abspath(__file__)) |
| | 147 | os.chdir(path) |
| | 148 | else: |
| | 149 | path = os.getcwd() # Seems necessary for py2exe |
| | 150 | |
| | 151 | sys.path = [path]+[p for p in sys.path if not p==path] |
| | 152 | |
| | 153 | # import gluon.import_all ##### This should be uncommented for py2exe.py |
| | 154 | import gluon.widget |
| | 155 | from gluon.shell import run |
| | 156 | |
| | 157 | # Start Web2py Scheduler -- Note the app name is hardcoded! |
| | 158 | if __name__ == '__main__': |
| | 159 | run('eden',True,True,None,False,"from gluon import current; current._scheduler.loop()") |
| | 160 | EOF |
| | 161 | |
| | 162 | |