OLD | NEW |
1 #This file is part of Tryton. The COPYRIGHT file at the top level of | 1 #This file is part of Tryton. The COPYRIGHT file at the top level of |
2 #this repository contains the full copyright notices and license terms. | 2 #this repository contains the full copyright notices and license terms. |
3 """ | 3 """ |
4 %prog [options] | 4 %prog [options] |
5 """ | 5 """ |
6 import logging | 6 import logging |
7 FORMAT = '[%(asctime)s] %(levelname)s:%(name)s:%(message)s' | 7 FORMAT = '[%(asctime)s] %(levelname)s:%(name)s:%(message)s' |
8 DATEFMT = '%a %b %d %H:%M:%S %Y' | 8 DATEFMT = '%a %b %d %H:%M:%S %Y' |
9 logging.basicConfig(level=logging.DEBUG, format=FORMAT, datefmt=DATEFMT) | 9 logging.basicConfig(level=logging.DEBUG, format=FORMAT, datefmt=DATEFMT) |
10 import logging.handlers | 10 import logging.handlers |
11 import sys, os, signal | 11 import sys, os, signal |
12 import time | 12 import time |
13 from trytond.config import CONFIG | 13 from trytond.config import CONFIG |
14 from getpass import getpass | 14 from getpass import getpass |
15 try: | 15 try: |
16 import hashlib | 16 import hashlib |
17 except ImportError: | 17 except ImportError: |
18 hashlib = None | 18 hashlib = None |
19 import sha | 19 import sha |
20 import threading | 20 import threading |
21 import string | 21 import string |
22 import random | 22 import random |
| 23 import tools.ElementPath |
| 24 from xml.etree import ElementPath |
| 25 ElementPath.find = tools.ElementPath.find |
| 26 ElementPath.findall = tools.ElementPath.findall |
| 27 ElementPath.findtext = tools.ElementPath.findtext |
23 | 28 |
24 | 29 |
25 class TrytonServer(object): | 30 class TrytonServer(object): |
26 | 31 |
27 def __init__(self): | 32 def __init__(self): |
28 CONFIG.parse() | 33 CONFIG.parse() |
29 | 34 |
30 if CONFIG['logfile']: | 35 if CONFIG['logfile']: |
31 logf = CONFIG['logfile'] | 36 logf = CONFIG['logfile'] |
32 # test if the directories exist, else create them | 37 # test if the directories exist, else create them |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 cron_obj = pool.get('ir.cron') | 244 cron_obj = pool.get('ir.cron') |
240 thread = threading.Thread( | 245 thread = threading.Thread( |
241 target=cron_obj.pool_jobs, | 246 target=cron_obj.pool_jobs, |
242 args=(dbname,), kwargs={}) | 247 args=(dbname,), kwargs={}) |
243 thread.start() | 248 thread.start() |
244 time.sleep(60) | 249 time.sleep(60) |
245 | 250 |
246 if __name__ == "__main__": | 251 if __name__ == "__main__": |
247 SERVER = TrytonServer() | 252 SERVER = TrytonServer() |
248 SERVER.run() | 253 SERVER.run() |
OLD | NEW |