当前位置: 首页>>代码示例>>Python>>正文


Python Job.create方法代码示例

本文整理汇总了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()
开发者ID:c24b,项目名称:crawlex,代码行数:11,代码来源:user_job.py

示例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)
开发者ID:EyeOfPython,项目名称:EvilTravianBot,代码行数:16,代码来源:eviltravian.py

示例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
开发者ID:EyeOfPython,项目名称:EvilTravianBot,代码行数:22,代码来源:sm_build.py

示例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())
开发者ID:sadikovi,项目名称:octohaven,代码行数:6,代码来源:octohaven.py

示例5: data_updated

# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import create [as 别名]
 def data_updated(self):
     self['job'] = Job.create(self['job'])
开发者ID:EyeOfPython,项目名称:EvilTravianBot,代码行数:4,代码来源:sm_build.py

示例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'})
开发者ID:EyeOfPython,项目名称:EvilTravianBot,代码行数:7,代码来源:sm_build.py

示例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()
开发者ID:debug001,项目名称:autorelease,代码行数:19,代码来源:job.py


注:本文中的job.Job.create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。