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

Comparing Python/NinoCode/Tool_Box/iTunesDirSync.py (file contents):
Revision 8 by ninoborges, Sat May 5 04:21:19 2012 UTC vs.
Revision 744 by nino.borges, Tue Apr 13 21:40:41 2021 UTC

# Line 26 | Line 26 | class DirDictionary:
26                  if self.reportType == 'Complex':
27                      hashVal = self.hasher.HashFile(os.path.join(currentDir, file))
28                      self.hashMatrix[os.path.join(currentDir, file)] = hashVal
29 <                if file in self.matrix.keys():
29 >                if file in list(self.matrix.keys()):
30                      self.matrix[file].append(os.path.join(currentDir, file))
31                  else:
32                      self.matrix[file] = [os.path.join(currentDir, file)]
33      def DuplicateReport(self):
34          dupCount = NinoGenTools.Counter()
35          
36 <        for i in self.matrix.keys():
36 >        for i in list(self.matrix.keys()):
37              instanceCount = len(self.matrix[i])
38              ## Query these "Dups" against the hash table and remove them if they're not.
39              
40              if instanceCount > 1:
41                  dupCount.inc()
42 <                print "-"*25
43 <                print "You have %d versions of %s" %(instanceCount, i)
42 >                print("-"*25)
43 >                print("You have %d versions of %s" %(instanceCount, i))
44                  for dir in self.matrix[i]:
45 <                    print dir
46 <                print "-"*25
47 <        print
48 <        print "*"*25
49 <        print "You have a total of %d duplicates" %dupCount.count
45 >                    print(dir)
46 >                print("-"*25)
47 >        print()
48 >        print("*"*25)
49 >        print("You have a total of %d duplicates" %dupCount.count)
50  
51  
52   class DirDictionaryComparisonTool:
# Line 61 | Line 61 | class DirDictionaryComparisonTool:
61          otherComputerMissingCount = NinoGenTools.Counter()
62          localMissingFileList =[]
63          otherMissingFileList =[]
64 <        for i in localComputer.matrix.keys():
65 <            if i in otherComputer.matrix.keys():
64 >        for i in list(localComputer.matrix.keys()):
65 >            if i in list(otherComputer.matrix.keys()):
66                  pass
67              else:
68                  otherMissingFileList.append(i)
69 <        for x in otherComputer.matrix.keys():
70 <            if x in localComputer.matrix.keys():
69 >        for x in list(otherComputer.matrix.keys()):
70 >            if x in list(localComputer.matrix.keys()):
71                  pass
72              else:
73                  localMissingFileList.append(x)
74  
75 <        print "*"*25
76 <        print "You are missing %d files, that the other computer has."%len(localMissingFileList)
77 <        print
78 <        raw_input("Press any key to see a list:")
79 <        print "-"*25
75 >        print("*"*25)
76 >        print("You are missing %d files, that the other computer has."%len(localMissingFileList))
77 >        print()
78 >        input("Press any key to see a list:")
79 >        print("-"*25)
80          for fileName in localMissingFileList:
81              for absFilePath in otherComputer.matrix[fileName]:
82 <                print absFilePath
83 <        print "-"*25
84 <        print "*"*25
85 <        print "The other computer is missing %d files, that you have."%len(otherMissingFileList)
86 <        print
87 <        raw_input("Press any key to see a list:")
88 <        print "-"*25
82 >                print(absFilePath)
83 >        print("-"*25)
84 >        print("*"*25)
85 >        print("The other computer is missing %d files, that you have."%len(otherMissingFileList))
86 >        print()
87 >        input("Press any key to see a list:")
88 >        print("-"*25)
89          for fileName in otherMissingFileList:
90              for absFilePath in localComputer.matrix[fileName]:
91 <                print absFilePath
92 <        print "-"*25
91 >                print(absFilePath)
92 >        print("-"*25)
93          

Diff Legend

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