-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimportQueue.py
57 lines (47 loc) · 1.47 KB
/
importQueue.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
from queueFile import *
from Tkinter import *
class importQueue(object):
def __init__(self):
self.queue = []
self.datedict = {}
def dateList(self,fileDate):
if fileDate not in self.datedict:
self.datedict[fileDate] = IntVar()
def append(self, filename):
self.queue.append(queueFile(filename))
self.dateList(self.queue[len(self.queue)-1].filedate)
def getFiles(self):
# files = []
# for file in self.queue:
# files.append(file.fullname)
# return files
return self.queue
def getDateCount(self):
# Gets the count for each date
pass
def length(self):
return len(self.queue)
def getExtCount(self, filetype):
# Gets teh count of each extension #
counts = {}
for file in self.queue:
ext = file.extension.lower()
if file.type == filetype:
if ext not in counts:
counts[ext] = 1
else:
counts[ext] += 1
return counts
def getTypeCount(self):
# Get the count for photos vs videos #
counts = {'Photo':0, 'Video':0}
for file in self.queue:
if file.type == 'Photo':
counts['Photo'] += 1
elif file.type == 'Video':
counts['Video'] += 1
else:
pass
return counts
def getDateList(self):
return self.datedict