-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMatchList.py
62 lines (57 loc) · 3 KB
/
MatchList.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
58
59
60
61
62
from datetime import datetime
import csv
from csv import reader
import os.path
from os import path
#---------------------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------------------
#------------------------------------ MatchList ----------------------------------------------------------------
#---------------------------------------------------------------------------------------------------------------
class MatchList:
# @static
dlpath = '/home/user/Download/'
dlen = 0
now_s = 0
sfname = ''
namesfile ='names.csv'
linksfile = 'links.csv'
#-----------------------------------------------------------------------------------------------------------
#-------------------------------- Constructor --------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------
def __init__(self, id_p = 0):
i = 0
self.dlen = len(self.dlpath)
now_s = datetime.now()
self.sfname = dlpath + id_p + '_Family_Finder_Matches_' + (now_s.strftime("%Y%m%d")) + '.csv'
print(self.sfname)
#-----------------------------------------------------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------
#-------------------------------- readFiles ----------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------
def readFiles():
kitsf = open('kits.csv')
kcsv = csv.reader(kitsf)
i=0
for k in kcsv:
names.add(i,k[o])
mkname()
#-----------------------------------------------------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------
#-------------------------------- getFreshMatchlists -------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------
@staticmethod
def getFreshMatchLists(fname_p):
dlpath = '/home/user/Downloads/'
now = datetime.now()
dlen = len(dlpath)
foundf = []
with open(fname_p, 'r') as read_obj2:
kcsv = reader(read_obj2)
i=0
for f in kcsv:
s = ('%s%s_Family_Finder_Matches_%s.csv' %(dlpath,f[0],(now.strftime("%Y%m%d"))) )
if os.path.isfile(s):
foundf.append(s)
i += 1
return(foundf)
#-----------------------------------------------------------------------------------------------------------