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


Python File.__init__方法代码示例

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


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

示例1: open

# 需要导入模块: from file import File [as 别名]
# 或者: from file.File import __init__ [as 别名]
    def open (self, mode = "a", buffering = None):  
        """open the file

        Args:
            mode: file open mode for the first file to be opened. other files will be opened in "w" mode
            buffering: same as in the built-in "open" command

        Returns:
            None

        Raises:
            IOError: same as in the built-in "open" command
            a.infra.lock.multi_process.LockError - when lock is not taken when required (only working in multi processes mode). 
        """
        
        self._verifyLockTakenIfNeeded()
        self._buffering = buffering            
        self._rotatingFileSizeEnforcer.prepare()
        self._rotatingFileSizeEnforcer.moveCurrentToPending()
        newFileName = self._rotatingFileSizeEnforcer.getCurrentFileName()
        self._log("open").debug1("first file name '%s'", newFileName)
        File.__init__(self, logger = self._log, fileName = newFileName, mode = mode, buffering = buffering)
        self._wasOpened = True
开发者ID:afeset,项目名称:miner2-tools,代码行数:25,代码来源:flex_output_file.py

示例2: __init__

# 需要导入模块: from file import File [as 别名]
# 或者: from file.File import __init__ [as 别名]
 def __init__(self, path=""):
     File.__init__(self, path)
开发者ID:starfox644,项目名称:bibmngr2015py,代码行数:4,代码来源:directory.py

示例3: __init__

# 需要导入模块: from file import File [as 别名]
# 或者: from file.File import __init__ [as 别名]
    def __init__(self, filename, filepath):
        File.__init__(self, filename, filepath)

        self.width, self.height = self.dimensions()
        self.entropy = self.entropy()
开发者ID:taufderl,项目名称:ProgITSec,代码行数:7,代码来源:quelltext_1_16.py

示例4: __init__

# 需要导入模块: from file import File [as 别名]
# 或者: from file.File import __init__ [as 别名]
 def __init__(self, name, id, path, type, service=None, last_modified=None):
     File.__init__(self, name, id, path, type, last_modified=last_modified)
     self.get(service)
     if service is not None:
         self.get(service)
         self.children = self._get_children(service)
开发者ID:ianhblakley,项目名称:linux_google_drive,代码行数:8,代码来源:folder.py


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