-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpychmviewer.py
executable file
·37 lines (27 loc) · 951 Bytes
/
pychmviewer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/python
# vim: set fileencoding=utf-8 :
" Provides the entry point of the whole app. "
import os
import sys
from argparse import ArgumentParser
from PyQt4 import QtGui
from session import Session
from pychmmainwindow import PyChmMainWindow
if __name__ == "__main__":
session = Session()
argparser = ArgumentParser(
description= "A CHM reader written in PyQt."
)
argparser.add_argument( "paths",
metavar="PATH",
nargs='*',
help="CHM File to open."
)
args = argparser.parse_args()
paths = [ unicode( os.path.realpath(path), session.system_encoding )
for path in args.paths
]
app = QtGui.QApplication(sys.argv)
mainwindow = PyChmMainWindow(session, paths)
mainwindow.show()
sys.exit(app.exec_())