Anonymous avatar Anonymous committed e31b8c7

* bugfixes

Comments (0)

Files changed (1)

src/unihistext.py

 import codecs
 from helpers import * 
 
-def unicode_xreadlines(input, encoding = 'utf-8'):
-    return codecs.iterdecode(input.xreadlines(), encoding=encoding)
-
 def main():
 
     from optparse import OptionParser
     parser.add_option("-i", "--input", dest="input", help="read Unicode stream from FILE ('-' means stdin, this is the default)", metavar="FILE", default="-")
     parser.add_option("--encoding", help="set input stream binary encoding ('utf-8' is the default)", default='utf-8')
     parser.add_option("-l", "--list-encodings", help="list some available encodings and exit", default=False, action="store_true")
-    parser.add_option("-v", "--version", help="print version and exit", default=False, action="store_true")
+    parser.add_option("-V", "--version", help="print version and exit", default=False, action="store_true")
     parser.add_option("-c", "--combining", help="recognize combining character sequences", default=False, action="store_true")
     parser.add_option("-n", "--names", help="print names of Unicode characters or sequences", default=False, action="store_true")
     parser.add_option("-S", "--sequence-names-file", help="use file in format of NamedSequences.txt from Unicode instead of system default",
     if options.combining: glue_combinings_ = glue_combinings
 
     stats = {}
-    for line in unicode_xreadlines(input):
+    for line in input:
 
         i = 0
         while i != len(line):
         return print_version()
     if options.list_encodings:
         return list_encodings()
-    input = sys.stdin if options.input == "-" else open(options.input, 'rb')
-    return print_hist(input, options, args)
+    return print_hist(open_input(options), options, args)
 
 if __name__ == "__main__":
     main()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.