|
@@ -5,6 +5,7 @@ class Slides():
|
|
|
def __init__(self,path):
|
|
def __init__(self,path):
|
|
|
if os.path.isdir(path) != True:
|
|
if os.path.isdir(path) != True:
|
|
|
print("PATH is not a dir")
|
|
print("PATH is not a dir")
|
|
|
|
|
+ self.data = "{'type'='diapo', 'value'='%s', 'number'='%d', 'total'='%d'}"
|
|
|
self.files=sorted(glob("%s/*.png" % path), key=self.key_func)
|
|
self.files=sorted(glob("%s/*.png" % path), key=self.key_func)
|
|
|
for f in range(0,len(self.files)):
|
|
for f in range(0,len(self.files)):
|
|
|
self.files[f] = os.path.abspath(self.files[f])
|
|
self.files[f] = os.path.abspath(self.files[f])
|
|
@@ -14,12 +15,12 @@ class Slides():
|
|
|
return int(os.path.split(x)[-1].rsplit('.', 1)[0])
|
|
return int(os.path.split(x)[-1].rsplit('.', 1)[0])
|
|
|
|
|
|
|
|
def cur(self):
|
|
def cur(self):
|
|
|
- return self.files[self.cur_diapo]
|
|
|
|
|
|
|
+ return ( self.data % (self.files[self.cur_diapo], self.cur_diapo+1, len(self.files)))
|
|
|
|
|
|
|
|
def prev(self):
|
|
def prev(self):
|
|
|
self.cur_diapo=max(self.cur_diapo-1, 0)
|
|
self.cur_diapo=max(self.cur_diapo-1, 0)
|
|
|
- return self.files[self.cur_diapo]
|
|
|
|
|
|
|
+ return self.cur()
|
|
|
|
|
|
|
|
def next(self):
|
|
def next(self):
|
|
|
self.cur_diapo=min(self.cur_diapo+1, len(self.files)-1)
|
|
self.cur_diapo=min(self.cur_diapo+1, len(self.files)-1)
|
|
|
- return self.files[self.cur_diapo]
|
|
|
|
|
|
|
+ return self.cur()
|