ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Tool_Box/BatesRangeFunctions.py
(Generate patch)

Comparing Python/NinoCode/Tool_Box/BatesRangeFunctions.py (file contents):
Revision 669 by nino.borges, Tue Dec 31 16:56:53 2019 UTC vs.
Revision 706 by nino.borges, Wed Jul 15 15:18:15 2020 UTC

# Line 110 | Line 110 | def GetBatesPageCount(begNo, endNo):
110              numb =+1
111      return numb +1
112  
113 + def GetBatesRanges(batesList):
114 +    """Takes a list of bates numbers (this single list will include all bates from beg and end values) and
115 +    returns a list of tuple ranges"""
116 +    batesMatrix = {}
117 +    batesRangeList = []
118 +    for bates in batesList:
119 +        alpha, numb  =  seperate_alpha(bates)
120 +        if alpha in batesMatrix.keys():
121 +            batesMatrix[alpha].append(bates)
122 +        else:
123 +            batesMatrix[alpha] = [bates,]
124 +    for batesGroup in batesMatrix.keys():
125 +        tempList = batesMatrix[batesGroup]
126 +        tempList.sort()
127 +        batesRangeList.append((tempList[0],tempList[-1]))
128 +    return batesRangeList
129 +
130   def EnumerateBates(begNo, endNo):
131      """Will return all the possible bates values in between begNo and endNo.  Split Alpha needs to be fixed
132      for bates with spaces.  This will error out if the begdoc or enddoc has a weird value like foo-001.a"""

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)