File: hash-of-file.py

package info (click to toggle)
solfege 3.16.4-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 34,472 kB
  • ctags: 5,287
  • sloc: python: 22,642; xml: 14,196; ansic: 4,682; makefile: 621; sh: 287
file content (24 lines) | stat: -rw-r--r-- 667 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/python
# GNU Solfege - free ear training software
# Copyright (C) 2009 Tom Cato Amundsen
# Licence is GPL, see file COPYING

from __future__ import absolute_import
import sys
sys.path.insert(0, ".")

import textwrap
from solfege import i18n
i18n.setup(".")
from solfege import statistics

print 
print "\n".join(textwrap.wrap( 
 "The hash value is calculated using solfege.statistics.hash_of_lessonfile(filename). "
 "This is the sha1 hash value of the file after lines starting with # and empty "
 "lines have been removed."))

print
print "filename:", sys.argv[1]
print "    replaces = \"%s\"" % statistics.hash_of_lessonfile(unicode(sys.argv[1]))
print