本文整理汇总了Python中job.Job.create方法的典型用法代码示例。如果您正苦于以下问题:Python Job.create方法的具体用法?Python Job.create怎么用?Python Job.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类job.Job
的用法示例。
在下文中一共展示了Job.create方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create
# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import create [as 别名]
def create(self):
self._logs["step"] = "registering new user"
self._logs["status"] = True
self.user = self.name
self.name = "none"
self.action = "crawl"
self.active = False
j = Job(self.__dict__)
return j.create()
示例2: __init__
# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import create [as 别名]
def __init__(self, user_name, password, nation, proxy):
self.travian = Travian(server, region, user_name, password, nation, proxy)
self.jobs = [ Job.create(job_dict) for job_dict in db.jobs.find({"user_name": user_name}, sort=[("time", 1)]) ]
user_db = self.get_user_db()
if 'build_idx' in user_db:
self.build_idx = user_db['build_idx']
else:
user_db['build_idx'] = [0, 0]
self.build_idx = [0, 0]
db.users.save(user_db)
示例3: _recursive_add_jobs
# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import create [as 别名]
def _recursive_add_jobs(self, parent, job_def):
if isinstance(job_def, tuple):
for jd in job_def:
self._recursive_add_jobs(parent, jd)
elif isinstance(job_def, list):
for jd in job_def:
p = self._recursive_add_jobs(parent, jd)
if p is not None:
parent = p
elif isinstance(job_def, dict):
job = Job.create(job_def)
#self.jobs.append(job)
sm = StateMachine_Job(self.village, {'start': { 'job': job } })
sm.current_state['after_job_id'] = parent['_jid']
sm.current_state.save_data()
self.state_machines.append(sm)
return job
示例4: job_create
# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import create [as 别名]
def job_create():
obj = request.get_json()
job = Job.create(db.session, **obj)
return success(job.json())
示例5: data_updated
# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import create [as 别名]
def data_updated(self):
self['job'] = Job.create(self['job'])
示例6: __init__
# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import create [as 别名]
def __init__(self, village):
self.village = village
#self.jobs = []
self.state_machines = []
self.root = Job.create({'type':'root'})
示例7: Job
# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import create [as 别名]
#encoding=utf-8
__author__ = 'jophyyao'
import sys
sys.path.insert(0, "../")
from job import Job
configs = {
'project' : 'test',
'tags' : 'testtag',
}
j = Job(configs)
j.option("name", "jophy", "user")
j.option("name", "yao", "user")
j.create()