本文整理汇总了Python中Qt4_create_task_base.CreateTaskBase.__subclasses__方法的典型用法代码示例。如果您正苦于以下问题:Python CreateTaskBase.__subclasses__方法的具体用法?Python CreateTaskBase.__subclasses__怎么用?Python CreateTaskBase.__subclasses__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Qt4_create_task_base.CreateTaskBase
的用法示例。
在下文中一共展示了CreateTaskBase.__subclasses__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _folder_ledit_change
# 需要导入模块: from Qt4_create_task_base import CreateTaskBase [as 别名]
# 或者: from Qt4_create_task_base.CreateTaskBase import __subclasses__ [as 别名]
def _folder_ledit_change(self, new_value):
"""
Descript. :
"""
if (self._base_image_dir is None):
if (type(self.parent) in CreateTaskBase.__subclasses__()):
self._base_image_dir = self.parent._session_hwobj.get_base_image_directory()
base_image_dir = self._base_image_dir
if (self._base_process_dir is None):
if (type(self.parent) in CreateTaskBase.__subclasses__()):
self._base_process_dir = self.parent._session_hwobj.get_base_process_directory()
base_proc_dir = self._base_process_dir
if (self._base_snapshot_dir is None):
if (type(self.parent) in CreateTaskBase.__subclasses__()):
self._base_snapshot_dir = self.parent._session_hwobj.get_base_snapshot_directory()
base_snap_dir = self._base_snapshot_dir
if (self._base_log_dir is None):
if (type(self.parent) in CreateTaskBase.__subclasses__()):
self._base_log_dir = self.parent._session_hwobj.get_base_log_directory()
base_log_dir = self._base_log_dir
new_sub_dir = str(new_value).strip(' ')
if len(new_sub_dir) > 0:
if new_sub_dir[0] == os.path.sep:
new_sub_dir = new_sub_dir[1:]
new_image_directory = os.path.join(base_image_dir, str(new_sub_dir))
new_snap_directory = os.path.join(base_snap_dir, str(new_sub_dir))
new_log_directory = os.path.join(base_log_dir, str(new_sub_dir))
new_proc_dir = os.path.join(base_proc_dir, str(new_sub_dir))
else:
new_image_directory = base_image_dir
new_snap_directory = base_snap_dir
new_log_directory = base_log_dir
new_proc_dir = base_proc_dir
self._data_model.directory = new_image_directory
self._data_model.snapshot_directory = new_snap_directory
self._data_model.log_directory = new_log_directory
self._data_model.process_directory = new_proc_dir
Qt4_widget_colors.set_widget_color(self.data_path_layout.folder_ledit,
Qt4_widget_colors.WHITE)
self.pathTemplateChangedSignal.emit()
示例2: _browse_clicked
# 需要导入模块: from Qt4_create_task_base import CreateTaskBase [as 别名]
# 或者: from Qt4_create_task_base.CreateTaskBase import __subclasses__ [as 别名]
def _browse_clicked(self):
"""
Descript. :
"""
get_dir = QtGui.QFileDialog(self)
if (self._base_image_dir is None):
if (type(self.parent) in CreateTaskBase.__subclasses__()):
self._base_image_dir = self.parent._session_hwobj.get_base_image_directory()
given_dir = self._base_image_dir
# LNLS
baseExist = False
while (not baseExist and (len(given_dir) > 0)):
if (os.path.exists(given_dir)):
baseExist = True
else:
given_dir = given_dir[:given_dir.rfind("/")]
d = str(get_dir.getExistingDirectory(self, "Select a directory", given_dir, QtGui.QFileDialog.ShowDirsOnly))
# LNLS
#d = os.path.dirname(d)
if d is not None and os.path.exists(d):
# Include default raw directory
if (type(self.parent) in CreateTaskBase.__subclasses__()):
d = os.path.join(d, self.parent._session_hwobj.raw_data_folder_name)
# Update _base_image_dir and _base_process_dir, so we can set it as current working directory
self._base_image_dir = d
self._base_process_dir = d
self._base_snapshot_dir = d
self._base_log_dir = d
# Set the new working directory
self.set_directory(d)
示例3: set_directory
# 需要导入模块: from Qt4_create_task_base import CreateTaskBase [as 别名]
# 或者: from Qt4_create_task_base.CreateTaskBase import __subclasses__ [as 别名]
def set_directory(self, directory):
"""
Descript. :
"""
if (self._base_image_dir is None):
if (type(self.parent) in CreateTaskBase.__subclasses__()):
self._base_image_dir = self.parent._session_hwobj.get_base_image_directory()
base_image_dir = self._base_image_dir
dir_parts = directory.split(base_image_dir)
if len(dir_parts) > 1:
sub_dir = dir_parts[1]
self._data_model.directory = directory
self.data_path_layout.folder_ledit.setText(sub_dir)
else:
self.data_path_layout.folder_ledit.setText('')
self._data_model.directory = base_image_dir
self.data_path_layout.base_path_ledit.setText(base_image_dir)