[Python-checkins] python/dist/src/Demo/md5test md5driver.py,1.2,1.3

akuchling@users.sourceforge.net akuchling@users.sourceforge.net
2003年4月24日 10:26:59 -0700


Update of /cvsroot/python/python/dist/src/Demo/md5test
In directory sc8-pr-cvs1:/tmp/cvs-serv604
Modified Files:
	md5driver.py 
Log Message:
Move all the imports to the top; use md5.new()
Index: md5driver.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/md5test/md5driver.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** md5driver.py	24 Apr 2003 17:26:22 -0000	1.2
--- md5driver.py	24 Apr 2003 17:26:56 -0000	1.3
***************
*** 1,3 ****
--- 1,5 ----
 import string
+ import md5
+ from sys import argv
 
 def MDPrint(str):
***************
*** 21,26 ****
 
 
- from md5 import md5
- 
 def MDTimeTrial():
 TEST_BLOCK_SIZE = 1000
--- 23,26 ----
***************
*** 43,47 ****
 t1 = time()
 
! mdContext = md5()
 
 for i in range(TEST_BLOCKS):
--- 43,47 ----
 t1 = time()
 
! mdContext = md5.new()
 
 for i in range(TEST_BLOCKS):
***************
*** 58,62 ****
 
 def MDString(str):
! MDPrint(md5(str).digest())
 print '"' + str + '"'
 
--- 58,62 ----
 
 def MDString(str):
! MDPrint(md5.new(str).digest())
 print '"' + str + '"'
 
***************
*** 64,68 ****
 def MDFile(filename):
 f = open(filename, 'rb');
! mdContext = md5()
 
 while 1:
--- 64,68 ----
 def MDFile(filename):
 f = open(filename, 'rb');
! mdContext = md5.new()
 
 while 1:
***************
*** 79,83 ****
 
 def MDFilter():
! mdContext = md5()
 
 while 1:
--- 79,83 ----
 
 def MDFilter():
! mdContext = md5.new()
 
 while 1:
***************
*** 106,111 ****
 MDFile('foo')
 
- 
- from sys import argv
 
 # I don't wanna use getopt(), since I want to use the same i/f...
--- 106,109 ----

AltStyle によって変換されたページ (->オリジナル) /