Last change
on this file since 7875 was
6631,
checked in by rwilson, 16 years ago
|
Another go at creating the 'mk_digest.py' program.
|
-
Property svn:executable set to
*
|
File size:
843 bytes
|
Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | |
---|
3 | '''A program to create a digest file from a data file.''' |
---|
4 | |
---|
5 | import sys |
---|
6 | import os |
---|
7 | from anuga.utilities.system_tools import make_digest_file |
---|
8 | |
---|
9 | # assumed program name - refreshed from command line args |
---|
10 | Prog_Name = 'mk_digest.py' |
---|
11 | |
---|
12 | # print usage info. and exit |
---|
13 | def usage(): |
---|
14 | print 'usage: %s <datafile> <digestfile>' % Prog_Name |
---|
15 | print 'where <datafile> is the file for which we create a digest string' |
---|
16 | print ' <digestfile> is the created file that contains the hex string.' |
---|
17 | sys.exit(10) |
---|
18 | |
---|
19 | # get program name |
---|
20 | # does this work on Windows? |
---|
21 | Prog_Name = os.path.basename(sys.argv[0]) |
---|
22 | |
---|
23 | # check args |
---|
24 | if len(sys.argv) != 3: |
---|
25 | usage() |
---|
26 | |
---|
27 | # get the filenames |
---|
28 | datafile = sys.argv[1] |
---|
29 | digestfile = sys.argv[2] |
---|
30 | |
---|
31 | # create the tarred/compressed file |
---|
32 | make_digest_file(datafile, digestfile) |
---|
Note: See
TracBrowser
for help on using the repository browser.