Example #1
0
 def timestamp(self):
     from burlap.common import get_last_modified_timestamp
     r = self.local_renderer
     fn = r.env.rsync_source_dir
     if self.verbose:
         print('tarball.fn:', fn)
     return get_last_modified_timestamp(fn, ignore=[_ for _ in r.env.exclusions if '/' not in _])
Example #2
0
 def timestamp(self):
     from burlap.common import get_last_modified_timestamp
     r = self.local_renderer
     fn = r.env.rsync_source_dir
     if self.verbose:
         print('tarball.fn:', fn)
     return get_last_modified_timestamp(
         fn, ignore=[_ for _ in r.env.exclusions if '/' not in _])
Example #3
0
def record_manifest_media(verbose=0):
    latest_timestamp = -1e9999999999999999
    if 'dj' in env.services:
        for path in iter_static_paths():
            latest_timestamp = max(
                latest_timestamp,
                common.get_last_modified_timestamp(path) or latest_timestamp)
    if int(verbose):
        print(latest_timestamp)
    return latest_timestamp
Example #4
0
def record_manifest_media(verbose=0):
    latest_timestamp = -1e9999999999999999
    if 'dj' in env.services:
        for path in iter_static_paths():
            latest_timestamp = max(
                latest_timestamp,
                common.get_last_modified_timestamp(path) or latest_timestamp)
    if int(verbose):
        print(latest_timestamp)
    return latest_timestamp
Example #5
0
 def record_manifest(self):
     latest_timestamp = -1e9999999999999999
     for path in iter_static_paths():
         if self.verbose:
             print('checking timestamp of path:', path)
         latest_timestamp = max(
             latest_timestamp,
             common.get_last_modified_timestamp(path) or latest_timestamp)
     if self.verbose:
         print('latest_timestamp:', latest_timestamp)
     return latest_timestamp
Example #6
0
 def record_manifest(self):
     latest_timestamp = -1e9999999999999999
     for path in iter_static_paths():
         if self.verbose:
             print('checking timestamp of path:', path)
         latest_timestamp = max(
             latest_timestamp,
             common.get_last_modified_timestamp(path) or latest_timestamp)
     if self.verbose:
         print('latest_timestamp:', latest_timestamp)
     return latest_timestamp
Example #7
0
 def record_manifest(self):
     """
     Called after a deployment to record any data necessary to detect changes
     for a future deployment.
     """
     from burlap.common import get_last_modified_timestamp
     data = 0
     for path in self.sync_media(iter_local_paths=1):
         data = min(data, get_last_modified_timestamp(path) or data)
     #TODO:hash media names and content
     if self.verbose:
         print('date:', data)
     return data
Example #8
0
 def get_media_timestamp(self):
     """
     Called after a deployment to record any data necessary to detect changes
     for a future deployment.
     """
     from burlap.common import get_last_modified_timestamp
     data = 0
     for path in self.sync_media(iter_local_paths=1):
         data = min(data, get_last_modified_timestamp(path) or data)
     # TODO:hash media names and content
     if self.verbose:
         print('date:', data)
     return data
Example #9
0
 def record_manifest(self):
     """
     Called after a deployment to record any data necessary to detect changes
     for a future deployment.
     """
     from burlap.common import get_last_modified_timestamp
     self.get_tarball_path()
     fn = self.env.absolute_src_dir
     if self.verbose:
         print('tarball.fn:', fn)
     data = get_last_modified_timestamp(fn)
     if self.verbose:
         print(data)
     return data
Example #10
0
    def get_media_timestamp(self, last_timestamp=None):
        """
        Retrieves the most recent timestamp of the media in the static root.

        If last_timestamp is given, retrieves the first timestamp more recent than this value.
        """
        r = self.local_renderer
        _latest_timestamp = -1e9999999999999999
        for path in self.iter_static_paths():
            path = r.env.static_root + '/' + path
            self.vprint('checking timestamp of path:', path)
            if not os.path.isfile(path):
                continue
            #print('path:', path)
            _latest_timestamp = max(_latest_timestamp, get_last_modified_timestamp(path) or _latest_timestamp)
            if last_timestamp is not None and _latest_timestamp > last_timestamp:
                break
        self.vprint('latest_timestamp:', _latest_timestamp)
        return _latest_timestamp
Example #11
0
File: dj.py Project: broxeph/burlap
    def get_media_timestamp(self, last_timestamp=None):
        """
        Retrieves the most recent timestamp of the media in the static root.

        If last_timestamp is given, retrieves the first timestamp more recent than this value.
        """
        r = self.local_renderer
        _latest_timestamp = -1e9999999999999999
        for path in self.iter_static_paths():
            path = r.env.static_root + '/' + path
            self.vprint('checking timestamp of path:', path)
            if not os.path.isfile(path):
                continue
            #print('path:', path)
            _latest_timestamp = max(
                _latest_timestamp,
                get_last_modified_timestamp(path) or _latest_timestamp)
            if last_timestamp is not None and _latest_timestamp > last_timestamp:
                break
        self.vprint('latest_timestamp:', _latest_timestamp)
        return _latest_timestamp