예제 #1
0
파일: model.py 프로젝트: satcomlabs/PyGnome
def get_web_step_data(request, step_data, model, images_url):
    filename = step_data['image_filename'].split(os.path.sep)[-1]
    image_url = request.static_url(
        'webgnome:static/%s/%s/%s/%s' %
        (images_url, model.id, util.get_filename_safe_time(
            model.changed_at), filename))

    return {
        'id': step_data['step_num'],
        'url': image_url,
        'timestamp': step_data['time_stamp']
    }
예제 #2
0
def get_web_step_data(request, step_data, model, images_url):
    filename = step_data['image_filename'].split(os.path.sep)[-1]
    image_url = request.static_url(
        'webgnome:static/%s/%s/%s/%s' % (
            images_url, model.id,
            util.get_filename_safe_time(model.changed_at), filename))

    return {
        'id': step_data['step_num'],
        'url': image_url,
        'timestamp': step_data['time_stamp']
    }
예제 #3
0
    def data_dir(self):
        """
        Return the expected path to the files for the current run of the model.

        This path is bound to the current value of ``self.changed_at`` so that
        we can invalidate a browser-based image cache when a model changes.
        """
        if not self.base_dir:
            return

        return os.path.join(self.base_dir,
                            util.get_filename_safe_time(self.changed_at))
예제 #4
0
    def data_dir(self):
        """
        Return the expected path to the files for the current run of the model.

        This path is bound to the current value of ``self.changed_at`` so that
        we can invalidate a browser-based image cache when a model changes.
        """
        if not self.base_dir:
            return

        return os.path.join(self.base_dir,
                            util.get_filename_safe_time(self.changed_at))