catherder/classes.py
def update_state(self, now=None):
        r"""Update the state record in the cache repository.

        Args:
            now (datetime.Datetime, optional): Timestamp that should be used
               in the name for the new file.

        """
        if now is None:
            now = datetime.datetime.utcnow()
        fname_old = utils.find_most_recent(self.cache_file_format,
                                           repo=self.cache_repo)
        fname_new = now.strftime(self.cache_file_format)
        fname_new_local = os.path.join(self.project_dir, fname_new)
        self.download_remote(fname_new_local)
        if fname_old is None:
            self.commit_state(fname_new,
                              "Creating initial %s cache" % self.name,
                              '%s cache does not exist. Should one be created?'
                              % self.name)
        else:
            diff = utils.get_diff(fname_old, fname_new_local)
            if diff:
                self.commit_state(fname_new,
                                  "Updating %s cache" % self.name,
                                  ("%s cache is out of date. The diff is "
                                   "\n%s\nShould the cache be updated?")
                                  % (self.name, diff))
            else:
                logger.info("%s cache remains the same." % self.name)
        if os.path.isfile(fname_new_local) and (self.cache_repo is not None):
            os.remove(fname_new_local)
        self.local_data = self.load_most_recent()
r"""Update the state record in the cache repository.

        Args:
            now (datetime.Datetime, optional): Timestamp that should be used
               in the name for the new file.

        
r"""Update the state record in the cache repository.
r " " " Update the state record in the cache repository .
def update_state(self, now=None):
        if now is None:
            now = datetime.datetime.utcnow()
        fname_old = utils.find_most_recent(self.cache_file_format,
                                           repo=self.cache_repo)
        fname_new = now.strftime(self.cache_file_format)
        fname_new_local = os.path.join(self.project_dir, fname_new)
        self.download_remote(fname_new_local)
        if fname_old is None:
            self.commit_state(fname_new,
                              "Creating initial %s cache" % self.name,
                              '%s cache does not exist. Should one be created?'
                              % self.name)
        else:
            diff = utils.get_diff(fname_old, fname_new_local)
            if diff:
                self.commit_state(fname_new,
                                  "Updating %s cache" % self.name,
                                  ("%s cache is out of date. The diff is "
                                   "\n%s\nShould the cache be updated?")
                                  % (self.name, diff))
            else:
                logger.info("%s cache remains the same." % self.name)
        if os.path.isfile(fname_new_local) and (self.cache_repo is not None):
            os.remove(fname_new_local)
        self.local_data = self.load_most_recent()
def update_state ( self , now = None ) : if now is None : now = datetime . datetime . utcnow ( ) fname_old = utils . find_most_recent ( self . cache_file_format , repo = self . cache_repo ) fname_new = now . strftime ( self . cache_file_format ) fname_new_local = os . path . join ( self . project_dir , fname_new ) self . download_remote ( fname_new_local ) if fname_old is None : self . commit_state ( fname_new , "Creating initial %s cache" % self . name , '%s cache does not exist. Should one be created?' % self . name ) else : diff = utils . get_diff ( fname_old , fname_new_local ) if diff : self . commit_state ( fname_new , "Updating %s cache" % self . name , ( "%s cache is out of date. The diff is " "\n%s\nShould the cache be updated?" ) % ( self . name , diff ) ) else : logger . info ( "%s cache remains the same." % self . name ) if os . path . isfile ( fname_new_local ) and ( self . cache_repo is not None ) : os . remove ( fname_new_local ) self . local_data = self . load_most_recent ( )
r"""Update the state record in the cache repository.
r " " " Update the state record in the cache repository .
r"""Update the state record in the cache repository.

        Args:
            now (datetime.Datetime, optional): Timestamp that should be used
               in the name for the new file.

        """
self
now
Timestamp that should be used
in the name for the new file.
Timestamp that should be used in the name for the new file .