tarina

git clone https://git.tarina.org/tarina
Log | Files | Refs | README | LICENSE

commit ced502c0ad29af6da4244031c18ba0679dcb07d2
parent b98e88466eb39d65135cb54fa711c07bee07884d
Author: rbckman <robinbackman@gmail.com>
Date:   Sat, 18 Aug 2018 11:30:41 +0300

get films into a dictionary

Diffstat:
Arandom/getfilms.py | 21+++++++++++++++++++++
Mtarina.py | 6++++++
2 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/random/getfilms.py b/random/getfilms.py @@ -0,0 +1,21 @@ +#!/usr/bin/python + +import os + +# Get path of the current dir, then use it as working directory: +rundir = os.path.dirname(__file__) +if rundir != '': + os.chdir(rundir) + +filmlibrary = {} +filmfolder = '/home/pi/Videos/' + +films = os.walk(filmfolder).next()[1] +renderedfilms = [] +unrenderedfilms = [] +for i in films: + if os.path.isfile(filmfolder + i + '/' + 'settings.p') == True: + lastupdate = os.path.getmtime(filmfolder + i + '/' + 'settings.p') + filmlibrary[i]=lastupdate + +print filmlibrary diff --git a/tarina.py b/tarina.py @@ -323,6 +323,12 @@ def update(tarinaversion, tarinavername): time.sleep(2) return tarinaversion, tarinavername +#-------------Get films--------------- + +def getfilms(): + #create a film dictionary + return + #-------------Load film--------------- def loadfilm(filmname, filmfolder):