ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/MCP/MCP_Console.py
Revision: 321
Committed: Tue Mar 26 14:51:35 2013 UTC (13 years ago) by nino.borges
Content type: text/x-python
File size: 28659 byte(s)
Log Message:
Added the disclosure letter feature with dialogs and warning message on main view edit.

File Contents

# Content
1 """
2
3 MCP_Console
4
5 Created by
6 Emanuel Borges
7 08.28.2010
8
9 This will be the interface to add, edit and archive cases.
10
11 Should this work as one large GUI and you pick the below or read from argv and let you
12 just call it with what you want, making these three look like separate apps.
13
14
15 """
16
17 import MCP_Lib,os,shutil,ConcordanceHelperTools, time,directorySize2
18
19 class MainConsole:
20 def __init__(self):
21 ## Gather the case list
22
23 print "connecting to matter tracking access db..."
24 ## Production version
25 self.accessDB = MCP_Lib.AccessDBConnection(r"\\chiads01\app\DS_CaseTrack\TPM_CaseTracking.mdb")
26 self.tPMName, self.tPMID, self.tPMOffice = MCP_Lib.GetTPMInfo()
27 #responsibleCases,casesDir = MCP_Lib.GetCaseList('',self.accessDB)
28 myCases, officeCases, allCases,casesDir= MCP_Lib.GetCaseList('',self.accessDB)
29
30 ## Testing version
31 #self.accessDB = MCP_Lib.AccessDBConnection(r"W:\Manny\testing\TPM_CaseTracking.mdb")
32 #responsibleCases,casesDir = MCP_Lib.GetCaseList(r"C:\Documents and Settings\eborges\My Documents\My Dropbox\Dev\Python\NinoCode\Active_prgs\Concordance\MCP",self.accessDB)
33 #self.tPMName, self.tPMID, self.tPMOffice = MCP_Lib.GetTPMInfo(r"C:\Documents and Settings\eborges\My Documents\My Dropbox\Dev\Python\NinoCode\Active_prgs\Concordance\MCP")
34
35 print "connected to DB."
36
37 self.responsibleCasesList = myCases
38 self.casesDir = casesDir
39
40
41 def AddNewCase(self, caseName, clientMatter, chargable = False, reviewPlatform = "", responsibleProcessingVendor = "",
42 responsibleScanningVendor = "",responsibleHostingVendor = ""):
43 ## Add the local folders The GUI should test that the clm is 10 digits and has hyphen.
44 template = os.path.join(self.casesDir,'_Template_')
45 new = os.path.join(self.casesDir, caseName + '_(%s)'%clientMatter)
46 if os.path.exists(new):
47 print "ERROR: This case already exists!!"
48 else:
49 #print template
50 #print new
51 os.mkdir(new)
52 for file in os.listdir(template):
53 shutil.copy2(os.path.join(template,file),new)
54 ## Check the H drive for the supplemental folders and the matter folder, only if they select Concordance.
55 self.SetCaseNameAndCLM(caseName,clientMatter)
56 self.AddCaseToAccessDB(caseName,clientMatter)
57
58 def AddCaseToAccessDB(self, caseName, clientMatter):
59 ## First test to see if it's already in the DB.
60 fullClientMatterList = self.accessDB.RetrieveAllCaseList()
61 clientMatter = clientMatter.replace("-",".")
62 if clientMatter in fullClientMatterList:
63 print "This client matter already exists in the database. Skipping."
64 else:
65 print "New client matter. Adding."
66 self.accessDB.AddNewCase(caseName, clientMatter, self.tPMName,self.tPMID,responsibleOffice = self.tPMOffice)
67 print "Added!"
68
69 def EditCaseData(self,caseName,chargeableBool,respAttorney,respParalegal,respVendorTpl,revPlatform,respTPM,respOffice, caseStatus):
70 clientMatter = caseName.split("_(")[1]
71 clientMatter = clientMatter[:-1]
72 clientMatter = clientMatter.replace('-','.')
73 self.accessDB.UpdateChargable(clientMatter,chargeableBool)
74 self.accessDB.UpdateResponsibleAttorney(clientMatter,respAttorney)
75 self.accessDB.UpdateResponsibleParalegal(clientMatter,respParalegal)
76 self.accessDB.UpdateReviewPlatform(clientMatter,revPlatform)
77 self.accessDB.UpdateResponsibleTPM(clientMatter,respTPM)
78 self.accessDB.UpdatePrimaryOffice(clientMatter,respOffice)
79 self.accessDB.UpdateResponsibleVendors(clientMatter,respVendorTpl)
80 self.accessDB.UpdateCaseStatus(clientMatter, caseStatus)
81
82 def GetCaseData(self, caseName):
83 #use this to get the data on the selected case, to populate your GUI
84 clientMatter = caseName.split("_(")[1]
85 clientMatter = clientMatter[:-1]
86 clientMatter = clientMatter.replace('-','.')
87 chargeableBool = self.accessDB.GetChargable(clientMatter)
88 respAttorney = self.accessDB.GetResponsibleAttorney(clientMatter)
89 respParalegal = self.accessDB.GetResponsibleParalegal(clientMatter)
90 respVendorTpl = self.accessDB.GetResponsibleVendorTpl(clientMatter)
91 revPlatform = self.accessDB.GetReviewPlatform(clientMatter)
92 respTPM = self.accessDB.GetResponsibleTPM(clientMatter)
93 respOffice = self.accessDB.GetPrimaryOffice(clientMatter)
94 caseStatus = self.accessDB.GetCaseStatus(clientMatter)
95 uploadCost = self.accessDB.GetUploadCostRate(clientMatter)
96 storageCost = self.accessDB.GetStorageCostRate(clientMatter)
97 disclosureLetterBool,disclosureLetterPath = self.accessDB.GetDisclosureLetter(clientMatter)
98 return (chargeableBool,respAttorney,respParalegal,respVendorTpl,revPlatform,respTPM,respOffice,caseStatus,uploadCost,storageCost,disclosureLetterBool)
99
100 def GetPossibleProducedToEntities(self,caseName):
101 """Returns the possible produced to entities for a case"""
102 clientMatter = caseName.split("_(")[1]
103 clientMatter = clientMatter[:-1]
104 clientMatter = clientMatter.replace('-','.')
105 possibleProducedToEntities = self.accessDB.GetProducedToEntities(clientMatter)
106 return possibleProducedToEntities
107
108 def GetPossibleProdReqByNames(self,caseName):
109 """Returns the possible requested by names for a case"""
110 clientMatter = caseName.split("_(")[1]
111 clientMatter = clientMatter[:-1]
112 clientMatter = clientMatter.replace('-','.')
113 possibleProdReqByNames = self.accessDB.GetProductionRequestedByNames(clientMatter)
114 return possibleProdReqByNames
115
116
117 def AddProductionEntry(self, CLM,prodID,prodProcessedDate,begBates,endBates,prodDocCount, prodPageCount, prodNotes, prodTo, prodMedia,prodSource,prodReqBy,prodSentDate,prodMediaPassword):
118 """This method adds one production entry to the case."""
119 errRpt = True
120 if CLM:
121 if prodID:
122 if prodProcessedDate:
123 if begBates:
124 if endBates:
125 if prodDocCount:
126 if prodPageCount:
127 if prodNotes:
128 self.accessDB.UpdateProductionDetail(CLM,prodID,prodProcessedDate,begBates,endBates,prodDocCount, prodPageCount, prodNotes, prodTo, prodMedia,prodSource,prodReqBy,prodSentDate,prodMediaPassword)
129 errRpt = False
130 return errRpt
131
132 def AddDataUpload(self,CLM, reviewPlatform, reportSize):
133 """This method will add one case upload."""
134 ## TODO: one day change it so that copy up requst calls this instead
135 ## of it being internal to that prog.
136 epoch = str(int(time.time()))
137 self.accessDB.UpdateCaseUpload(CLM,reviewPlatform,{epoch:(time.strftime('%m/%d/%Y'),reportSize)})
138
139 def RemoveDataUpload(self,CLM,UEPOCH):
140 """This method calls DeleteCaseUpload and removes just one case upload. """
141 err = self.accessDB.DeleteCaseUpload(CLM,UEPOCH)
142 if err:
143 print "ERROR: An Error occured and this value was not removed!"
144 else:
145 print "%s Removed"% UEPOCH
146
147 def GetUploadData(self, caseName):
148 # Used to get upload data, on the selected case, to populate the upload dialog
149 clientMatter = caseName.split("_(")[1]
150 clientMatter = clientMatter[:-1]
151 clientMatter = clientMatter.replace('-','.')
152 uploadList = self.accessDB.RetrieveUploadsByCLM(clientMatter)
153 return uploadList
154
155 def GetProductionData(self,caseName):
156 clientMatter = caseName.split("_(")[1]
157 clientMatter = clientMatter[:-1]
158 clientMatter = clientMatter.replace('-','.')
159 productionMatrix = self.accessDB.RetrieveProductionsByCLM(clientMatter)
160 return productionMatrix
161
162 def GetProductionTotal(self,productionList):
163 """Using the above productionList, this returns the total docs and pages produced"""
164 pgCountTotal = 0
165 docCountTotal = 0
166 for i in productionList:
167 pageCount = i[-7]
168 docCount = i[-8]
169 if 'None' in pageCount:
170 pass
171 else:
172 #print pageCount
173 pgCountTotal = pgCountTotal+int(pageCount)
174 if 'None' in pageCount:
175 pass
176 else:
177 #print docCount
178 docCountTotal = docCountTotal+int(docCount)
179 return pgCountTotal,docCountTotal
180
181 def ExportProductionDataToExcel(self,CaseName,pathToCSV):
182 """Exports the production data to a csv file"""
183 productionList = self.GetProductionData(CaseName)
184 #print productionList
185 outputFile = open(pathToCSV,'w')
186 outputFile.write('Production ID,Production Completed Date,Production Sent Date,Start Bates,End Bates,Document Count,Page Count,Produced To,Requested By,Production Media,ProductionMediaPassword,Production Sources,Notes\n')
187 for i in productionList:
188 for x in i:
189 outputFile.write(x+",")
190 outputFile.write("\n")
191 outputFile.close()
192
193 def GetUploadTotal(self,uploadList):
194 """ Using the above uploadList, this will return the total uploaded """
195 count = 0.
196 for i in uploadList:
197 size = i[-1]
198
199 if 'None' in size:
200 pass
201 else:
202 rawSize = directorySize2.prettyToUnpretty_Filesize(size)
203 count = count + rawSize
204 prettySizeFinal = directorySize2.pretty_filesize2(count)
205 return prettySizeFinal
206
207 def MakeCaseDormant(self, caseAndCLM):
208 """Moves the case to the Dormant folder"""
209 print "Making %s case dormant..."
210 os.rename(os.path.join(self.casesDir,caseAndCLM),os.path.join(self.casesDir,os.path.join('zzzz_dormant_', caseAndCLM)))
211 print "Case has been archived."
212
213
214 def ViewCaseNotes(self,caseName,office):
215 """Trys to open the case notes file,in the case folder, for the active case, regardless who owns it."""
216 caseFolderLocation = MCP_Lib.GetOtherCaseFolder(office)
217 clientMatter = caseName.split("_(")[1]
218 clientMatter = clientMatter[:-1]
219 if "." in clientMatter:
220 clientMatter = clientMatter.replace('.','-')
221 folderMatrix = {}
222 #caseFolderLocation = os.path.join(caseFolderLocation,case)
223 err = False
224 if caseFolderLocation:
225 if os.path.exists(caseFolderLocation):
226 for f in os.listdir(caseFolderLocation):
227 if "_(" in f:
228 folderClientMatter = f.split("_(")[1]
229 folderClientMatter = folderClientMatter[:-1]
230 folderMatrix[folderClientMatter] = f
231 try:
232 folderName = folderMatrix[clientMatter]
233 os.startfile(os.path.join(caseFolderLocation, folderName)+"/Gen_Notes.txt")
234 except:
235 err = True
236 else:
237 err = True
238 else:
239 print "A case folder for this case was not found."
240 err = True
241 return err
242
243 def ViewProdSpec(self,caseName,office):
244 """Trys to open the prod spec file,in the case folder, for the active case, regardless who owns it."""
245 caseFolderLocation = MCP_Lib.GetOtherCaseFolder(office)
246 clientMatter = caseName.split("_(")[1]
247 clientMatter = clientMatter[:-1]
248 if "." in clientMatter:
249 clientMatter = clientMatter.replace('.','-')
250 folderMatrix = {}
251 #caseFolderLocation = os.path.join(caseFolderLocation,case)
252 err = False
253 if caseFolderLocation:
254 if os.path.exists(caseFolderLocation):
255 for f in os.listdir(caseFolderLocation):
256 if "_(" in f:
257 folderClientMatter = f.split("_(")[1]
258 folderClientMatter = folderClientMatter[:-1]
259 folderMatrix[folderClientMatter] = f
260 try:
261 folderName = folderMatrix[clientMatter]
262 os.startfile(os.path.join(caseFolderLocation, folderName+"/Production_Spec.txt"))
263 except:
264 err = True
265 else:
266 err = True
267 else:
268 print "A case folder for this case was not found."
269 err = True
270 return err
271
272 def CreateProductionReport(self,caseName,office):
273 """Creates a html production report in the altMediaPath folder"""
274 err = False
275 clientMatter = caseName.split("_(")[1]
276 clientMatter = clientMatter[:-1]
277 clientMatter = clientMatter.replace('-','.')
278 altMediaPath = self.accessDB.GetAlternateMediaPath(clientMatter)
279 productionMatrix = self.GetProductionData(caseName)
280 if os.path.exists(os.path.join(altMediaPath,'__MCP_Data')):
281 pass
282 else:
283 os.mkdir(os.path.join(altMediaPath,'__MCP_Data'))
284 reportFile = open(os.path.join(os.path.join(altMediaPath,'__MCP_Data'),'MCP_Production_Report.html'),'w')
285 reportFile.write('''<html>\n<head>\n <title>MCP: %s Production Report</title>\n <style type="text/css" media="screen">\n\n'''%caseName)
286 reportFile.write(r'''div#Rsidebar {
287 float: right;
288 width: 20%;
289 }
290 div#Lsidebar {
291 float: left;
292 width:20%;
293 height:380px;
294 }
295
296 </style>''')
297 reportFile.write('''
298 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
299 <meta name="author" content="Emanuel Borges">
300 </head>
301 <body>
302
303 <h3><br>
304 </h3>
305 <center><h2>%s Production Report</h2></center>'''%caseName)
306 reportFile.write(r'''<center><hr width="40%"></center>''')
307 for k in productionMatrix.keys():
308 productionList = productionMatrix[k]
309 reportFile.write("<h4>%s Productions</h3>" % k)
310 reportFile.write('''<center><table border=1 cellspacing=0 cellpadding=5 width=1800>\n<tr><th>Production ID</th><th>Processed Date</th><th>Sent Date</th><th>Start Bates</th><th>End Bates</th><th>Document Count</th><th>Page Count</th><th>Requested By</th><th>Production Media</th><th>Media Password</th><th>Production Sources</th><th>Notes</th></tr>''')
311 for i in productionList:
312 reportFile.write("<tr>")
313 count = 1
314 for x in i:
315 if count == 8:
316 count = count + 1
317 else:
318 reportFile.write("<td>%s</td>"%x)
319 count = count +1
320 reportFile.write("</tr>")
321
322 reportFile.write('</table></center>\n\n')
323 reportFile.write('''<div id="footer">
324 <p><span>&copy; 2012 <a href="#">Emanuel Borges</a></span><br />
325 Website automatically generated by the MCP program.</p></div>''')
326 reportFile.write('</body></html>\n')
327 reportFile.close()
328 return err
329
330 def OpenAlternateMediaFolder(self,caseName,office,testOnly=False):
331 """Trys to open the Alternate media folder, for the active case, regardless who owns it.
332 If testOnly is set to True, it will only test that it exists and not open the folder."""
333 clientMatter = caseName.split("_(")[1]
334 clientMatter = clientMatter[:-1]
335 clientMatter = clientMatter.replace('-','.')
336 altMediaPath = self.accessDB.GetAlternateMediaPath(clientMatter)
337 err = False
338 if altMediaPath:
339 if os.path.exists(altMediaPath):
340 if testOnly:
341 pass
342 else:
343 os.startfile(altMediaPath)
344 else:
345 print "An alternate media folder for this case was not found."
346 err = True
347 else:
348 err = True
349 return err
350
351 def SetAlternateMediaFolder(self,caseName,altMediaPath):
352 """Sets the alternate Media Path"""
353 clientMatter = caseName.split("_(")[1]
354 clientMatter = clientMatter[:-1]
355 clientMatter = clientMatter.replace('-','.')
356 self.accessDB.UpdateAlternateMediaPath(clientMatter,altMediaPath)
357
358 def GetVendorFolders(self,caseName):
359 """Returns the current list of vendor folders, for one case"""
360 clientMatter = caseName.split("_(")[1]
361 clientMatter = clientMatter[:-1]
362 clientMatter = clientMatter.replace('-','.')
363 vendorFolders = self.accessDB.GetVendorFolderPath(clientMatter)
364 #print "V%s "%vendorFolders
365 return vendorFolders
366
367 def SetVendorFolders(self,caseName, vendorFolders):
368 """Sets the Vendor Folder"""
369 clientMatter = caseName.split("_(")[1]
370 clientMatter = clientMatter[:-1]
371 clientMatter = clientMatter.replace('-','.')
372 self.accessDB.UpdateVendorFolderPath(clientMatter,vendorFolders)
373
374 def GetVendorFoldersList(self):
375 """Returns a list of all vendorFolders"""
376 ## Change this so that it actually grabs the current ones from ln. Dont know if I should grab from a table in access.
377 vendorFolderList = ["None"]
378 for n in range(1,61):
379 vendorFolderList.append("mwevendor%0*d"%(2,n))
380 return vendorFolderList
381
382 def GetDisclosureLetterData(self,caseName):
383 """Returns the the bool of if a case has a disclosure letter and if so the path."""
384 clientMatter = caseName.split("_(")[1]
385 clientMatter = clientMatter[:-1]
386 clientMatter = clientMatter.replace('-','.')
387 disclosureLetterSet, disclosureLetterPath = self.accessDB.GetDisclosureLetter(clientMatter)
388 return disclosureLetterSet, disclosureLetterPath
389
390 def SetDisclosureLetterData(self,caseName,disclosureLetterPath):
391 """Sets the disclosure letter path and checks it as true in the database"""
392 clientMatter = caseName.split("_(")[1]
393 clientMatter = clientMatter[:-1]
394 clientMatter = clientMatter.replace('-','.')
395 self.accessDB.UpdateDisclosureLetter(clientMatter,True,disclosureLetterPath)
396
397 def GetCasePathsData(self,caseName, office):
398 clientMatter = caseName.split("_(")[1]
399 clientMatter = clientMatter[:-1]
400 clientMatter = clientMatter.replace('-','.')
401 altMediaPath = self.accessDB.GetAlternateMediaPath(clientMatter)
402 caseFolderLocation = MCP_Lib.GetOtherCaseFolder(office)
403 caseFolderLocation = os.path.join(caseFolderLocation,caseName)
404 return altMediaPath, caseFolderLocation
405
406 def SetUploadAndStorageCosts(self, caseName,uploadCost,storageCost):
407 clientMatter = caseName.split("_(")[1]
408 clientMatter = clientMatter[:-1]
409 clientMatter = clientMatter.replace('-','.')
410 if uploadCost:
411 self.accessDB.UpdateUploadCostRate(clientMatter,uploadCost)
412 if storageCost:
413 self.accessDB.UpdateStorageCostRate(clientMatter,storageCost)
414
415 def OpenCaseFolder(self,caseName,office):
416 """Trys to open the case folder for the active case, regardless who owns it."""
417 caseFolderLocation = MCP_Lib.GetOtherCaseFolder(office)
418 clientMatter = caseName.split("_(")[1]
419 clientMatter = clientMatter[:-1]
420 if "." in clientMatter:
421 clientMatter = clientMatter.replace('.','-')
422 folderMatrix = {}
423 #caseFolderLocation = os.path.join(caseFolderLocation,case)
424 err = False
425 if caseFolderLocation:
426 if os.path.exists(caseFolderLocation):
427 for f in os.listdir(caseFolderLocation):
428 if "_(" in f:
429 folderClientMatter = f.split("_(")[1]
430 folderClientMatter = folderClientMatter[:-1]
431 folderMatrix[folderClientMatter] = f
432 try:
433 folderName = folderMatrix[clientMatter]
434 os.startfile(os.path.join(caseFolderLocation, folderName))
435 except:
436 err = True
437 else:
438 err = True
439 else:
440 print "A case folder for this case was not found."
441 err = True
442 return err
443
444
445 def SetCaseNameAndCLM(self, newCaseName, newClientMatterNumber):
446 """Used when setting up a new case. Should have both or nothing"""
447 self.caseName = newCaseName
448 self.clientMatter = newClientMatterNumber
449 #print self.clientMatter
450
451 def SetChargableCase(self, chargBool):
452 """sets or clears the chargable case settings"""
453 pass
454 def SetResponsibleVendor(self, vendorInfo):
455 """Sets the vendor name that is responsible for the case"""
456 pass
457 def SetReviewPlatform(self, reviewPlatform):
458 """Sets the review platform chosen for this case"""
459 if reviewPlatform == "Concordance":
460 print "Concordance selected. Creating DIS directories..."
461 hDrivePath = ConcordanceHelperTools.ParseClientMatter(self.clientMatter)
462 os.mkdir(hDrivePath)
463 print "Matter folder created."
464 os.mkdir(os.path.join(hDrivePath,'Match'))
465 os.mkdir(os.path.join(hDrivePath,'Tag_Databases'))
466 print "Supplemental folders created."
467 print "DIS directories done!"
468
469 def GetDatabaseList(self,caseName):
470 """Returns the list of databases in the database list file."""
471 return ['datbase1','database2','database3']
472
473 def SyncWithAccessDB(self,case = 'ALL'):
474 """Syncs your cases with the access database. This might only get run once when you first install
475 the program though..."""
476 ## So this syncs 'your' databases only. even though you are looking at a list of eeryone's databases
477 ## it will only sync yours. even if you did an upload for another tpm, that wouldnt get synced unles
478 ## the owner did a sync all. for 2 way sync to work, you should check, in access, that they have the case name
479 ## (with no funky characters) populated, before they run this for the first time.
480 if case == 'ALL':
481 ## verify that all your cases are up there, if not add it. but have support for cases where is should be
482 ## yours but is assigned to someone else...
483 fullClientMatterList = self.accessDB.RetrieveAllCaseList()
484 myAccessClientMatterList = self.accessDB.RetrieveMyCaseList(self.tPMID)
485 myLocalClientMatterList = []
486
487 ## Sync cases from my local to access
488 for case in self.responsibleCasesList:
489 localCaseName,clientMatter = case.split("_(")
490 clientMatter = clientMatter.replace(")","")
491 clientMatter = clientMatter.replace("-",".")
492 myLocalClientMatterList.append(clientMatter)
493 for clm in myLocalClientMatterList:
494 if clm in myAccessClientMatterList:
495 print "%s exists"% clm
496 elif clm in fullClientMatterList:
497 print "%s cant be added to your cases because it's owned by someone else..."% clm
498 else:
499 print "%s does not exist in the database. Adding it..."% clm
500 self.AddCaseToAccessDB(localCaseName,clientMatter)
501
502 ## Sync cases from Access to my local
503
504
505 uploadReportMatrix = {}
506 for caseName in self.responsibleCasesList:
507 print "now processing %s"% caseName
508 casePath = os.path.join(self.casesDir,caseName)
509 if os.path.exists(os.path.join(casePath,"UploadReport.txt")):
510 print "yup"
511 caseUploadContents = open(os.path.join(casePath,"UploadReport.txt")).readlines()
512 clientMatter = caseName.split("_(")[1]
513 clientMatter = clientMatter.replace(")","")
514 clientMatter = clientMatter.replace("-",".")
515 for i in caseUploadContents:
516 i = i.replace("\n","")
517 i = i.replace(" | ","|")
518 try:
519 uploadReportMatrix[clientMatter].append(("%s"%i.split("|")[0],"%s"%i.split("|")[1],"%s"%i.split("|")[2],"%s"%i.split("|")[3]))
520 except:
521 uploadReportMatrix[clientMatter] = [("%s"%i.split("|")[0],"%s"%i.split("|")[1],"%s"%i.split("|")[2],"%s"%i.split("|")[3])]
522 #print uploadReportMatrix
523
524 accessMyCaseUploads = self.accessDB.RetrieveMyCaseUploads('09756')
525 for x in uploadReportMatrix.keys():
526 localCaseUploadList = uploadReportMatrix[x]
527 tempMatrix = {}
528 try:
529 accessCaseUploadList = accessMyCaseUploads[x]
530 #print accessCaseUploadList
531 for y in localCaseUploadList:
532 epoch = y[0]
533 if int(epoch) > 1298462400:
534 #print epoch
535 reviewPlatform = y[1]
536 reportSize = y[3]
537 #print "."
538 #print accessCaseUploadList
539 if epoch in accessCaseUploadList:
540 print "%s, in the %s case, is already in there, skipping."%(y,x)
541 else:
542 print "%s, in the %s case, is missing. Will be added..."%(y,x)
543 date = y[2]
544 date = "%s/%s/%s"%(date[4:6],date[6:],date[:4])
545
546 self.accessDB.UpdateCaseUpload(x,reviewPlatform,{epoch:(date,reportSize)})
547 #tempMatrix[epoch] = [platform,(date,size)]
548 else:
549 #print "This entry is pre cutover"
550 pass
551 except KeyError:
552 print "nothing for this one"
553 for z in localCaseUploadList:
554 print "%s, in the %s case, is missing. Will be added..."%(z,x)
555 date = z[0]
556 date = "%s/%s/%s"%(date[4:6],date[6:],date[:4])
557 #try:
558 # tempMatrix[date].append(z[1])
559 #except:
560 # tempMatrix[date] = [z[1]]
561 #print tempMatrix
562 #if tempMatrix:
563 # #print tempMatrix
564 # self.accessDB.UpdateCaseUpload(x,'Concordance DIS', tempMatrix)
565 #pass
566
567
568 #print myLocalClientMatterList
569 ## verify that all of your uploads are up there, if not, add it.
570 self.accessDB.CloseAccessConnection()
571
572 else:
573 fullClientMatterList = self.accessDB.RetrieveAllCaseList()
574 myAccessClientMatterList = self.accessDB.RetrieveMyCaseList(self.tPMID)
575
576