Esempio n. 1
0
    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
Esempio n. 2
0
    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
Esempio n. 3
0
 def __init__(self, path=""):
     File.__init__(self, path)
Esempio n. 4
0
    def __init__(self, filename, filepath):
        File.__init__(self, filename, filepath)

        self.width, self.height = self.dimensions()
        self.entropy = self.entropy()
Esempio n. 5
0
 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)
Esempio n. 6
0
 def __init__(self):
     File.__init__(self)
     Ping.__init__(self)
     Valid.__init__(self)