本文整理汇总了Python中easyprocess.EasyProcess.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python EasyProcess.__init__方法的具体用法?Python EasyProcess.__init__怎么用?Python EasyProcess.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类easyprocess.EasyProcess
的用法示例。
在下文中一共展示了EasyProcess.__init__方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from easyprocess import EasyProcess [as 别名]
# 或者: from easyprocess.EasyProcess import __init__ [as 别名]
def __init__(self):
mutex.acquire()
try:
self.display = self.search_for_display()
while self.display in USED_DISPLAY_NR_LIST:
self.display+=1
USED_DISPLAY_NR_LIST.append(self.display)
finally:
mutex.release()
EasyProcess.__init__(self, self._cmd)
示例2: __init__
# 需要导入模块: from easyprocess import EasyProcess [as 别名]
# 或者: from easyprocess.EasyProcess import __init__ [as 别名]
def __init__(self, use_xauth=False):
mutex.acquire()
try:
self.display = self.search_for_display()
while self.display in USED_DISPLAY_NR_LIST:
self.display+=1
USED_DISPLAY_NR_LIST.append(self.display)
finally:
mutex.release()
if use_xauth and not xauth.is_installed():
raise xauth.NotFoundError()
self.use_xauth = use_xauth
self._old_xauth = None
self._xauth_filename = None
EasyProcess.__init__(self, self._cmd)
示例3: start
# 需要导入模块: from easyprocess import EasyProcess [as 别名]
# 或者: from easyprocess.EasyProcess import __init__ [as 别名]
def start(self):
'''
start display
:rtype: self
'''
self.display = self.search_for_display()
EasyProcess.__init__(self, self._cmd)
EasyProcess.start(self)
# https://github.com/ponty/PyVirtualDisplay/issues/2
self.old_display_var = os.environ['DISPLAY'] if 'DISPLAY' in os.environ else ':0'
self.redirect_display(True)
# wait until X server is active
# TODO: better method
time.sleep(0.1)
return self
示例4: __init__
# 需要导入模块: from easyprocess import EasyProcess [as 别名]
# 或者: from easyprocess.EasyProcess import __init__ [as 别名]
def __init__(self):
self.display = self.search_for_display()
EasyProcess.__init__(self, self._cmd)