本文整理汇总了Python中task.Task.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Task.__init__方法的具体用法?Python Task.__init__怎么用?Python Task.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类task.Task
的用法示例。
在下文中一共展示了Task.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from task import Task [as 别名]
# 或者: from task.Task import __init__ [as 别名]
def __init__(self, conf):
Task.__init__(self,conf)
self.name = 'MySql'
self.packages = ['mysql-server','mysql-client']
self.addRequiredFields(['mysql_username','mysql_database_name','mysql_password'])
Task.checkRequiredConf(self,conf)
示例2: __init__
# 需要导入模块: from task import Task [as 别名]
# 或者: from task.Task import __init__ [as 别名]
def __init__(self, conf):
Task.__init__(self, conf)
self.name = "Nginx"
self.addRequiredFields(["base_dir", "domain_name", "nginx_template_url"])
self.packages = ["nginx"]
self.checkRequiredConf(conf)
示例3: __init__
# 需要导入模块: from task import Task [as 别名]
# 或者: from task.Task import __init__ [as 别名]
def __init__(self, robot, link, target, **kwargs):
if hasattr(target, 'robot_link'): # used for ROS communications
target.robot_link = link.index # dirty
elif type(target) is list:
target = array(target)
def _pos_residual(target_pose):
residual = target_pose - link.pose
if dot(residual[0:4], residual[0:4]) > 1.:
return _oppose_quat * target_pose - link.pose
return residual
if hasattr(target, 'pose'):
def pos_residual():
return _pos_residual(target.pose)
elif type(target) is ndarray:
def pos_residual():
return _pos_residual(target)
else: # link frame target should be a pose
raise Exception("Target %s has no 'pose' attribute" % type(target))
def jacobian():
return robot.compute_link_pose_jacobian(link)
self.link = link
Task.__init__(self, jacobian, pos_residual=pos_residual, **kwargs)
示例4: __init__
# 需要导入模块: from task import Task [as 别名]
# 或者: from task.Task import __init__ [as 别名]
def __init__(self, conf):
Task.__init__(self,conf)
self.name = 'Django Install'
self.addRequiredFields(['django_url','base_dir','domain_name'])
self.packages = ['cron','python-mysqldb']
self.checkRequiredConf(conf)
示例5: __init__
# 需要导入模块: from task import Task [as 别名]
# 或者: from task.Task import __init__ [as 别名]
def __init__(self, foot = core.Kick.RIGHT, desiredDistance = 2000.0):
Task.__init__(self)
self.kickRunning = False
self.postKick = False
self.foot = foot
self.desiredDistance = desiredDistance
self.sm = SimpleStateMachine(['startup', 'kicking', 'finish'])
示例6: __init__
# 需要导入模块: from task import Task [as 别名]
# 或者: from task.Task import __init__ [as 别名]
def __init__(self, url, path=None, overwrite=False, **kwargs):
Task.__init__(self)
self.url = url
self.path = path
self.overwrite = overwrite
self.kwargs = kwargs
self.size = 0
示例7: __init__
# 需要导入模块: from task import Task [as 别名]
# 或者: from task.Task import __init__ [as 别名]
def __init__(self, project, name):
Task.__init__(self)
Persistent.__init__(self, project.persistent, name)
self.name = name
self.fhs = FHS.shared(project)
project.option_collector.option_decls.add(self.__class__)
self.check_missing = project.options.get('check-missing', 'yes') != 'no'
示例8: __init__
# 需要导入模块: from task import Task [as 别名]
# 或者: from task.Task import __init__ [as 别名]
def __init__(self, message, hosts):
Task.__init__(self)
self.__message = message
self.__hosts = hosts
with database.transaction() as t:
t.execute("SELECT CURRENT_TIMESTAMP AT TIME ZONE 'UTC'")
(self.__batch_time,) = t.fetchone()
示例9: __init__
# 需要导入模块: from task import Task [as 别名]
# 或者: from task.Task import __init__ [as 别名]
def __init__(self, config, is_append=False):
name = 'append_file_stat_task' if is_append else 'generate_file_stat_task'
Task.__init__(self, name)
self._config = config
self._is_append = is_append
self._stat_cache = {}
self._cache_path = os.path.join(self._config['build_cache_dir'], 'stat_cache.json')
示例10: __init__
# 需要导入模块: from task import Task [as 别名]
# 或者: from task.Task import __init__ [as 别名]
def __init__(self, robot, q_ref, exclude_dofs=None, **kwargs):
"""
Create task.
INPUT:
- ``robot`` -- a Robot object
"""
assert len(q_ref) == robot.nb_dofs
J_posture = eye(robot.nb_dofs)
if exclude_dofs is None:
exclude_dofs = []
if robot.has_free_flyer: # don't include free-flyer coordinates
exclude_dofs.extend([
robot.TRANS_X, robot.TRANS_Y, robot.TRANS_Z, robot.ROT_Y])
for i in exclude_dofs:
J_posture[i, i] = 0.
def pos_residual():
e = (q_ref - robot.q)
for j in exclude_dofs:
e[j] = 0.
return e
def jacobian():
return J_posture
Task.__init__(self, jacobian, pos_residual=pos_residual, **kwargs)
示例11: __init__
# 需要导入模块: from task import Task [as 别名]
# 或者: from task.Task import __init__ [as 别名]
def __init__(self, options, option_collector):
Task.__init__(self)
option_collector.option_decls.add(self.__class__)
src_path = options.get('src-dir', None)
if src_path is None: src_path = os.getcwd()
bld_path = options.get('bld-dir', None)
if bld_path is None: bld_path = os.path.join(src_path, '++wonderbuild')
if src_path == bld_path: raise Exception, 'build dir and source dir are the same'
self.list_aliases = 'list-tasks' in options
self.task_aliases = {} # {name: [tasks]}
aliases = options.get('tasks', None)
if aliases is not None:
if len(aliases) != 0: self.requested_task_aliases = aliases.split(',')
else: self.requested_task_aliases = (None,)
else: self.requested_task_aliases = None
# TODO See note in PurgeablePersistentDict
if False: self.global_purge = options.get('purge-persistent', 'no') != 'no'
else: self.global_purge = False
self.processsing = False
gc_enabled = gc.isenabled()
if gc_enabled:
try: gc.disable()
except NotImplementedError: pass # jython uses the gc of the jvm
try:
try: f = open(os.path.join(bld_path, 'persistent.pickle'), 'rb')
except IOError: raise
else:
try:
if __debug__ and is_debug: t0 = time.time()
pickle_abi_sig = cPickle.load(f)
if pickle_abi_sig != abi_sig:
print >> sys.stderr, colored('33', 'wonderbuild: abi sig changed: discarding persistent pickle file => full rebuild will be performed')
persistent = PurgeablePersistentDict()
else:
persistent = cPickle.load(f)
if __debug__ and is_debug: debug('project: pickle: load time: ' + str(time.time() - t0) + ' s')
except:
print >> sys.stderr, colored('33', 'wonderbuild: could not load persistent pickle file => full rebuild will be performed')
import traceback; traceback.print_exc()
raise
finally: f.close()
except:
persistent = PurgeablePersistentDict()
finally:
if gc_enabled: gc.enable()
self.fs = FileSystem(persistent)
self.top_src_dir = self.fs.cur / src_path
bld_dir = self.fs.cur / bld_path
SharedTaskHolder.__init__(self, persistent, options, option_collector, bld_dir)
示例12: __init__
# 需要导入模块: from task import Task [as 别名]
# 或者: from task.Task import __init__ [as 别名]
def __init__(self, fname=None):
Task.__init__(self, fname)
self.isMetallic = self.config.getboolean('KConverger','isMetallic')
self.kInit = [ int(k) for k in split(self.config.get('KConverger','kInit')) ]
self.kStep = [ int(k) for k in split(self.config.get('KConverger','kStep')) ]
self.kConverger()
示例13: __init__
# 需要导入模块: from task import Task [as 别名]
# 或者: from task.Task import __init__ [as 别名]
def __init__(self, dest = 115 * core.DEG_T_RAD, stepSize = 26 * core.DEG_T_RAD, skipFirstPause = False):
Task.__init__(self)
self.dest = dest
self.stepSize = stepSize
self.pauseTime = 0.2083
self.skipFirstPause = skipFirstPause
self.isPaused = True
self.timer = util.Timer()
示例14: __init__
# 需要导入模块: from task import Task [as 别名]
# 或者: from task.Task import __init__ [as 别名]
def __init__(self, time = 3.0):
Task.__init__(self)
self.subtask = skills.PoseSequence(
cfgpose.blockright, 1.0,
cfgpose.blockright, time,
cfgpose.sittingPoseNoArms, 2.0,
cfgpose.standingPose, 2.0
)
示例15: __init__
# 需要导入模块: from task import Task [as 别名]
# 或者: from task.Task import __init__ [as 别名]
def __init__(self, config_node):
Task.__init__(self)
self.task_node = getNode("/task", True)
self.ap_node = getNode("/autopilot", True)
self.engine_node = getNode("/controls/engine", True)
self.saved_fcs_mode = ""
self.name = config_node.getString("name")
self.nickname = config_node.getString("nickname")