(self, timestamp=None)
return self.stored_time
Write UTC timestamp to a plist.

    If no timestamp is supplied, write current UTC time to self.timeplist plist.
    If plist exists, update the PLIST_TIMESTAMP_KEY.

    Args:
      timestamp: UTC datetime object
    Returns:
      datetime object stored
    Raises:
      ErrorWritingPlist: SetPlistKey fails
      OSError: if more >1 parent directory is missing from self.timeplist path
Write UTC timestamp to a plist.
Write UTC timestamp to a plist .
def WriteTimeFile(self, timestamp=None):
    """Write UTC timestamp to a plist.

    If no timestamp is supplied, write current UTC time to self.timeplist plist.
    If plist exists, update the PLIST_TIMESTAMP_KEY.

    Args:
      timestamp: UTC datetime object
    Returns:
      datetime object stored
    Raises:
      ErrorWritingPlist: SetPlistKey fails
      OSError: if more >1 parent directory is missing from self.timeplist path
    """
    if timestamp:
      self.stored_time = timestamp
    else:
      self.stored_time = datetime.datetime.utcnow()

    # This will only handle one missing parent dir
    # os.mkdirs not available in version of python we run
    if not os.path.exists(os.path.dirname(self.timeplist)):
      os.mkdir(os.path.dirname(self.timeplist))

    timestr = self.stored_time.strftime('%Y-%m-%d %H:%M:%S UTC')
    if not gmacpyutil.SetPlistKey(self.timeplist, PLIST_TIMESTAMP_KEY, timestr):
      raise ErrorWritingPlist('Could not write to %s in %s'
                              % (PLIST_TIMESTAMP_KEY, self.timeplist))
    return self.stored_time
def WriteTimeFile ( self , timestamp = None ) : if timestamp : self . stored_time = timestamp else : self . stored_time = datetime . datetime . utcnow ( ) # This will only handle one missing parent dir # os.mkdirs not available in version of python we run if not os . path . exists ( os . path . dirname ( self . timeplist ) ) : os . mkdir ( os . path . dirname ( self . timeplist ) ) timestr = self . stored_time . strftime ( '%Y-%m-%d %H:%M:%S UTC' ) if not gmacpyutil . SetPlistKey ( self . timeplist , PLIST_TIMESTAMP_KEY , timestr ) : raise ErrorWritingPlist ( 'Could not write to %s in %s' % ( PLIST_TIMESTAMP_KEY , self . timeplist ) ) return self . stored_time