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


Python General.boolstr_to_bool方法代码示例

本文整理汇总了Python中General.boolstr_to_bool方法的典型用法代码示例。如果您正苦于以下问题:Python General.boolstr_to_bool方法的具体用法?Python General.boolstr_to_bool怎么用?Python General.boolstr_to_bool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在General的用法示例。


在下文中一共展示了General.boolstr_to_bool方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import General [as 别名]
# 或者: from General import boolstr_to_bool [as 别名]
 def __init__(self, action_element):
     """Initialize file search"""
     self.regex = action_element.getAttribute('regex')
     assert(isinstance(self.regex, (str, unicode, types.NoneType)))
     self.nregex = action_element.getAttribute('nregex')
     assert(isinstance(self.nregex, (str, unicode, types.NoneType)))
     self.wholeregex = action_element.getAttribute('wholeregex')
     assert(isinstance(self.wholeregex, (str, unicode, types.NoneType)))
     self.nwholeregex = action_element.getAttribute('nwholeregex')
     assert(isinstance(self.nwholeregex, (str, unicode, types.NoneType)))
     self.search = action_element.getAttribute('search')
     self.object_type = action_element.getAttribute('type')
     self.path = os.path.expanduser(FileUtilities.expandvars(
         action_element.getAttribute('path')))
     if 'nt' == os.name and self.path:
         # convert forward slash to backslash for compatibility with getsize()
         # and for display.  Do not convert an empty path, or it will become
         # the current directory (.).
         self.path = os.path.normpath(self.path)
     self.ds = {}
     if 'deep' == self.search:
         self.ds['regex'] = self.regex
         self.ds['nregex'] = self.nregex
         self.ds['cache'] = General.boolstr_to_bool(
             action_element.getAttribute('cache'))
         self.ds['command'] = action_element.getAttribute('command')
         self.ds['path'] = self.path
     if not any([self.object_type, self.regex, self.nregex, self.wholeregex, self.nwholeregex]):
         # If the filter is not needed, bypass it for speed.
         self.get_paths = self._get_paths
开发者ID:austinvernsonger,项目名称:bleachbit,代码行数:32,代码来源:Action.py

示例2: __init__

# 需要导入模块: import General [as 别名]
# 或者: from General import boolstr_to_bool [as 别名]
 def __init__(self, action_element):
     """Initialize file search"""
     self.regex = action_element.getAttribute('regex')
     assert(isinstance(self.regex, (str, unicode, types.NoneType)))
     self.nregex = action_element.getAttribute('nregex')
     assert(isinstance(self.nregex, (str, unicode, types.NoneType)))
     self.search = action_element.getAttribute('search')
     self.object_type = action_element.getAttribute('type')
     self.path = os.path.expanduser(os.path.expandvars(
         action_element.getAttribute('path')))
     if 'nt' == os.name and self.path:
         # convert forward slash to backslash for compatibility with getsize()
         # and for display.  Do not convert an empty path, or it will become
         # the current directory (.).
         self.path = os.path.normpath(self.path)
     self.ds = {}
     if 'deep' == self.search:
         self.ds['regex'] = self.regex
         self.ds['nregex'] = self.nregex
         self.ds['cache'] = General.boolstr_to_bool(
             action_element.getAttribute('cache'))
         self.ds['command'] = action_element.getAttribute('command')
         self.ds['path'] = self.path
     if self.object_type:
         if 'f' == self.object_type:
             self.object_filter = os.path.isfile
         elif 'd' == self.object_type:
             self.object_filter = os.path.isdir
         else:
             raise RuntimeError('unsupported type %s in %s' % \
                 (self.object_type, self.action_element))
     else:
         # faster to bypass
         self.get_paths = self._get_paths
开发者ID:bakasa,项目名称:bleachbit,代码行数:36,代码来源:Action.py

示例3: __init__

# 需要导入模块: import General [as 别名]
# 或者: from General import boolstr_to_bool [as 别名]
 def __init__(self, action_element):
     """Initialize file search"""
     self.regex = action_element.getAttribute('regex')
     assert(isinstance(self.regex, (str, unicode, types.NoneType)))
     self.search = action_element.getAttribute('search')
     self.path = os.path.expanduser(os.path.expandvars( \
         action_element.getAttribute('path')))
     self.ds = {}
     if 'deep' == self.search:
         self.ds['regex'] = self.regex
         self.ds['cache'] = General.boolstr_to_bool(action_element.getAttribute('cache'))
         self.ds['command'] = action_element.getAttribute('command')
         self.ds['path'] = self.path
开发者ID:hotelzululima,项目名称:bleachbit,代码行数:15,代码来源:Action.py

示例4: __init__

# 需要导入模块: import General [as 别名]
# 或者: from General import boolstr_to_bool [as 别名]
 def __init__(self, action_element):
     """Initialize file search"""
     self.regex = action_element.getAttribute('regex')
     assert(isinstance(self.regex, (str, unicode, types.NoneType)))
     self.search = action_element.getAttribute('search')
     self.path = os.path.expanduser(os.path.expandvars(
         action_element.getAttribute('path')))
     if 'nt' == os.name and self.path:
         # convert forward slash to backslash for compatibility with getsize()
         # and for display.  Do not convert an empty path, or it will become
         # the current directory (.).
         self.path = os.path.normpath(self.path)
     self.ds = {}
     if 'deep' == self.search:
         self.ds['regex'] = self.regex
         self.ds['cache'] = General.boolstr_to_bool(
             action_element.getAttribute('cache'))
         self.ds['command'] = action_element.getAttribute('command')
         self.ds['path'] = self.path
开发者ID:Nullstr1ng,项目名称:bleachbit,代码行数:21,代码来源:Action.py

示例5: __init__

# 需要导入模块: import General [as 别名]
# 或者: from General import boolstr_to_bool [as 别名]
 def __init__(self, action_element):
     """Initialize file search"""
     self.regex = action_element.getAttribute("regex")
     assert isinstance(self.regex, (str, unicode, types.NoneType))
     self.nregex = action_element.getAttribute("nregex")
     assert isinstance(self.nregex, (str, unicode, types.NoneType))
     self.search = action_element.getAttribute("search")
     self.path = os.path.expanduser(os.path.expandvars(action_element.getAttribute("path")))
     if "nt" == os.name and self.path:
         # convert forward slash to backslash for compatibility with getsize()
         # and for display.  Do not convert an empty path, or it will become
         # the current directory (.).
         self.path = os.path.normpath(self.path)
     self.ds = {}
     if "deep" == self.search:
         self.ds["regex"] = self.regex
         self.ds["nregex"] = self.nregex
         self.ds["cache"] = General.boolstr_to_bool(action_element.getAttribute("cache"))
         self.ds["command"] = action_element.getAttribute("command")
         self.ds["path"] = self.path
开发者ID:ihewitt,项目名称:bleachbit,代码行数:22,代码来源:Action.py


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