Пример #1
0
def get_finished_timelapses():
    files = []
    basedir = settings().getBaseFolder("timelapse", check_writable=False)
    for entry in os.scandir(basedir):
        if util.is_hidden_path(entry.path) or not valid_timelapse(entry.path):
            continue

        thumb = create_thumbnail_path(entry.path)
        if os.path.isfile(thumb) is True:
            thumb = os.path.basename(thumb)
        else:
            thumb = None

        files.append({
            "name":
            entry.name,
            "size":
            util.get_formatted_size(entry.stat().st_size),
            "bytes":
            entry.stat().st_size,
            "thumbnail":
            thumb,
            "timestamp":
            entry.stat().st_mtime,
            "date":
            util.get_formatted_datetime(
                datetime.datetime.fromtimestamp(entry.stat().st_mtime)),
        })
    return files
Пример #2
0
		def finalize_fields(prefix, job):
			currently_recording = current is not None and current.prefix == prefix
			currently_rendering = current_render_job is not None and current_render_job["prefix"] == prefix

			job["size"] = util.get_formatted_size(job["bytes"])
			job["date"] = util.get_formatted_datetime(datetime.datetime.fromtimestamp(job["timestamp"]))
			job["recording"] = currently_recording
			job["rendering"] = currently_rendering
			job["processing"] = currently_recording or currently_rendering
			del job["timestamp"]

			return job
Пример #3
0
		def finalize_fields(prefix, job):
			currently_recording = current is not None and current.prefix == prefix
			currently_rendering = current_render_job is not None and current_render_job["prefix"] == prefix

			job["size"] = util.get_formatted_size(job["bytes"])
			job["date"] = util.get_formatted_datetime(datetime.datetime.fromtimestamp(job["timestamp"]))
			job["recording"] = currently_recording
			job["rendering"] = currently_rendering
			job["processing"] = currently_recording or currently_rendering
			del job["timestamp"]

			return job
Пример #4
0
def get_finished_timelapses():
	files = []
	basedir = settings().getBaseFolder("timelapse")
	for entry in scandir(basedir):
		if not fnmatch.fnmatch(entry.name, "*.mp[g4]"):
			continue
		files.append({
			"name": entry.name,
			"size": util.get_formatted_size(entry.stat().st_size),
			"bytes": entry.stat().st_size,
			"date": util.get_formatted_datetime(datetime.datetime.fromtimestamp(entry.stat().st_mtime))
		})
	return files
Пример #5
0
def get_finished_timelapses():
	files = []
	basedir = settings().getBaseFolder("timelapse")
	for entry in scandir(basedir):
		if not fnmatch.fnmatch(entry.name, "*.mp[g4]"):
			continue
		files.append({
			"name": entry.name,
			"size": util.get_formatted_size(entry.stat().st_size),
			"bytes": entry.stat().st_size,
			"date": util.get_formatted_datetime(datetime.datetime.fromtimestamp(entry.stat().st_ctime))
		})
	return files
Пример #6
0
def get_finished_timelapses():
	files = []
	basedir = settings().getBaseFolder("timelapse", check_writable=False)
	for entry in scandir(basedir):
		if util.is_hidden_path(entry.path) or not valid_timelapse(entry.path):
			continue
		files.append({
			"name": entry.name,
			"size": util.get_formatted_size(entry.stat().st_size),
			"bytes": entry.stat().st_size,
			"date": util.get_formatted_datetime(datetime.datetime.fromtimestamp(entry.stat().st_mtime))
		})
	return files
Пример #7
0
def getFinishedTimelapses():
	files = []
	basedir = settings().getBaseFolder("timelapse")
	for osFile in os.listdir(basedir):
		if not fnmatch.fnmatch(osFile, "*.mpg"):
			continue
		statResult = os.stat(os.path.join(basedir, osFile))
		files.append({
			"name": osFile,
			"size": util.get_formatted_size(statResult.st_size),
			"bytes": statResult.st_size,
			"date": util.get_formatted_datetime(datetime.datetime.fromtimestamp(statResult.st_ctime))
		})
	return files
Пример #8
0
def get_finished_timelapses():
	files = []
	basedir = settings().getBaseFolder("timelapse")
	for osFile in os.listdir(basedir):
		if not fnmatch.fnmatch(osFile, "*.mp[g4]"):
			continue
		statResult = os.stat(os.path.join(basedir, osFile))
		files.append({
			"name": osFile,
			"size": util.get_formatted_size(statResult.st_size),
			"bytes": statResult.st_size,
			"date": util.get_formatted_datetime(datetime.datetime.fromtimestamp(statResult.st_ctime))
		})
	return files
Пример #9
0
def get_finished_timelapses():
    files = []
    basedir = settings().getBaseFolder("timelapse", check_writable=False)
    for entry in scandir(basedir):
        if util.is_hidden_path(entry.path) or not valid_timelapse(entry.path):
            continue
        files.append(
            {
                "name": entry.name,
                "size": util.get_formatted_size(entry.stat().st_size),
                "bytes": entry.stat().st_size,
                "date": util.get_formatted_datetime(
                    datetime.datetime.fromtimestamp(entry.stat().st_mtime)
                ),
            }
        )
    return files
Пример #10
0
	def finalize_fields(job):
		job["size"] = util.get_formatted_size(job["bytes"])
		job["date"] = util.get_formatted_datetime(datetime.datetime.fromtimestamp(job["timestamp"]))
		del job["timestamp"]
		return job
Пример #11
0
	def finalize_fields(job):
		job["size"] = util.get_formatted_size(job["bytes"])
		job["date"] = util.get_formatted_datetime(datetime.datetime.fromtimestamp(job["timestamp"]))
		del job["timestamp"]
		return job