ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Tool_Box/LitTechHelperTools.py
Revision: 624
Committed: Fri Nov 4 15:12:53 2016 UTC (9 years, 4 months ago) by nino.borges
Content type: text/x-python
File size: 1151 byte(s)
Log Message:
version 1

File Contents

# User Rev Content
1 nino.borges 624 """
2    
3     LitTechHelperTools.py
4    
5     Created by
6     Emanuel Borges
7    
8     This is a collection of generic litigation technology tools, like taking
9     begimage and begattach and making a dict.
10    
11     """
12    
13     import os
14    
15     def FamilyToDict(dbExport):
16     """Takes an export of bates and begattach and makes a dir. should be pipe delimited and no quotes"""
17     ## Returns a dict where the parent is the key and the first value in the list (but only if its in the document)
18     familyDict = {}
19     for line in dbExport:
20     line = line.replace("\n","")
21     bates,begAttach = line.split("|")
22     if bates == begAttach:
23     ## Im a parent
24     if bates in familyDict.keys():
25     pass
26     else:
27     familyDict[bates] = [bates,]
28     else:
29     ## Im a child
30     if begAttach in familyDict.keys():
31     familyDict[begAttach].append(bates)
32     else:
33     ## I removed this line vecause there will be times where the parent is missing from the export
34     #familyDict[begAttach] = [begAttach,bates]
35     familyDict[begAttach] = [bates,]
36     return familyDict
37    
38    
39