forked from jpopelka/hplip
-
Notifications
You must be signed in to change notification settings - Fork 1
/
uiscan.py
executable file
·74 lines (56 loc) · 2.18 KB
/
uiscan.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env python
__version__ = '2.2'
__mod__ = 'hp-uiscan'
__title__ = 'Scan Utility'
__doc__ = "SANE-based scan utility for HPLIP supported all-in-one/mfp devices."
from base import utils, module
#from installer import core_install
import os
from math import log
from base.g import *
import operator
try:
from importlib import import_module
except ImportError as e:
log.debug(e)
from base.utils import dyn_import_mod as import_module
#from scan import sane
#import scanext
#mod = module.Module(__mod__, __title__, __version__, __doc__, None, (INTERACTIVE_MODE,))
mod = module.Module(__mod__, __title__, __version__, __doc__, None, (GUI_MODE,), (UI_TOOLKIT_QT4, UI_TOOLKIT_QT5))
mod.setUsage(module.USAGE_FLAG_NONE, extra_options=None, see_also_list = ['hp-scan'])
if __name__ == "__main__":
opts, device_uri, printer_name, mode, ui_toolkit, lang=mod.parseStdOpts()
#print (device_uri)
#device_uri = mod.getDeviceUri(device_uri, printer_name, back_end_filter=['hpaio'], filter={'scan-type': (operator.gt, 0)}, devices=devicelist)
#print (device_uri)
'''try:
#print (device_uri)
device = sane.openDevice(device_uri)
#print (device)
except scanext.error as e:
#sane.reportError(e.args[0])
#sys.exit(1)'''
#k=core_install.CoreInstall()
#k.get_distro()
#print k.distro_name
#print k.distro_version
#ui_toolkit = k.get_distro_ver_data('ui_toolkit').lower()
'''if ui_toolkit == 'qt4':
os.system('python ui4/scan.py')
elif ui_toolkit == 'qt5':
os.system('python ui5/scan.py')'''
QApplication, ui_package = utils.import_dialog(ui_toolkit)
ui = import_module(ui_package + ".scandialog")
obj=ui.SetupDialog()
#obk=obj.setupUi(devicelist)
obj.setupUi()
#print obk
'''list_scanjet=imageprocessing.validate_scanjet_support()
#print (list_scanjet)
if(list_scanjet[2] == 'False'):
scanjet_error="Scanjet features are not supported and disabled for %s %s. Please upgrade to latest distro version"% (list_scanjet[0],list_scanjet[1])
ui.failureMessage(scanjet_error)
ui.DisableAllScanjet() '''
#obk[0].show()
#sys.exit(obk[1].exec_())