123456789101112131415161718192021222324252627 |
- # -*- coding: utf-8 -*-
- import sys
- sys.getdefaultencoding()
- reload(sys)
- sys.setdefaultencoding('UTF-8')
- from demeter.core import *
- import time
- # 测试命令行传参 python convert.py -f file.doc
- param = {}
- param['file'] = 'f'
- Demeter.getopt(param)
- file = Demeter.option['file']
- convert = Demeter.service('convert')
- if file:
- id = int(file)
- convert.handle(id)
- else:
- model = Demeter.model('convert')
- model.status = 3
- info = model.select(type='fetchall')
- if info:
- for i in info:
- redis = Demeter.redis()
- config = Demeter.config['redis']
- redis.rpush(config['name'], i['id'])
|