Commit 4a731652 authored by Didier 'OdyX' Raboud's avatar Didier 'OdyX' Raboud

Imported Upstream version 3.13.11

parent 0422e14b

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -10,6 +10,7 @@ CXXFLAGS+= -DCONFDIR=\"$(hplip_confdir)\"
hplipdir = $(datadir)/hplip
docdir = $(hpdocdir)
htmldir = $(hphtmldir)
doc_DATA = COPYING copyright prnt/hpijs/README_LIBJPG
EXTRA_DIST = prnt/hpijs/gdevijs-krgb-1.5-gs8.61.patch prnt/hpijs/README_LIBJPG copyright
......@@ -24,11 +25,11 @@ include cups_drv.inc
if DOC_BUILD
wwwsrc = doc
www0dir = $(docdir)
www0dir = $(htmldir)
dist_www0_DATA = $(wwwsrc)/index.html $(wwwsrc)/commandline.html $(wwwsrc)/copying.html $(wwwsrc)/devicemanager.html $(wwwsrc)/faxtrouble.html $(wwwsrc)/gettinghelp.html $(wwwsrc)/hpscan.html $(wwwsrc)/mainttask.html $(wwwsrc)/plugins.html $(wwwsrc)/print.html $(wwwsrc)/printing.html $(wwwsrc)/printoptions.html $(wwwsrc)/printtroubleshooting.html $(wwwsrc)/scanning.html $(wwwsrc)/scantrouble.html $(wwwsrc)/sendfax.html $(wwwsrc)/setup.html $(wwwsrc)/systray.html $(wwwsrc)/troubleshooting.html $(wwwsrc)/uninstalling.html $(wwwsrc)/upgrading.html
www3dir = $(docdir)/styles
www3dir = $(htmldir)/styles
dist_www3_DATA = $(wwwsrc)/styles/*
www4dir = $(docdir)/images
www4dir = $(htmldir)/images
dist_www4_DATA = $(wwwsrc)/images/*
endif
......@@ -102,12 +103,6 @@ libhpip_la_SOURCES = ip/xconvolve.c ip/xfax.c ip/xgrayout.c ip/xjpg_dct.c ip/xjp
ip/xbi2gray.c ip/xcolrspc.c ip/xfakemono.c ip/xgray2bi.c ip/xinvert.c ip/xjpg_enc.c ip/xmatrix.c ip/xpnm.c ip/xscale.c ip/xthumb.c ip/xyxtract.c \
ip/hpip.h ip/ipdefs.h ip/xform.h ip/xjpg_dct.h ip/xjpg_huf.h ip/xjpg_mrk.h
# hp-mkuri.
hp_mkuridir = $(bindir)
hp_mkuri_PROGRAMS = hp-mkuri
hp_mkuri_SOURCES = io/hpmud/hp-mkuri.c
hp_mkuri_LDADD = -ldl libhpmud.la
hp_mkuri_CFLAGS = -DCONFDIR=\"$(hplip_confdir)\"
#hpmud rules data dir
rulessystemdir=/usr/lib/systemd/system
......@@ -136,10 +131,6 @@ pstotiff_SCRIPTS = fax/filters/pstotiff
hplip_statedir = /var/lib/hp
dist_hplip_state_DATA =
# Log Files
hplip_Logdir=/var/log/hp
hplip_tmpdir=/var/log/hp/tmp
if FULL_BUILD
dist_hplip_SCRIPTS = hpssd.py __init__.py hpdio.py
......@@ -215,8 +206,6 @@ postscriptdir = $(hplipdir)/data/ps
localzdir = $(hplipdir)/data/localization
dist_postscript_DATA = data/ps/testpage.ps.gz data/ps/clean_page.pdf.gz
dist_models_DATA = data/models/models.dat
dist_hplip_Log_DATA=
dist_hplip_tmp_DATA=
if GUI_BUILD
dist_images_16x16_DATA = data/images/16x16/*
......@@ -532,31 +521,6 @@ cupsdrv2dir = $(drvdir)
cupsdrv2_DATA = $(cups_drv)
endif
install-dist_hplip_LogDATA:
if FULL_BUILD
test -z "$(DESTDIR)$(hplip_Logdir)" || mkdir -p $(DESTDIR)$(hplip_Logdir)
chgrp "lp" -R $(DESTDIR)$(hplip_Logdir)
chmod 775 $(DESTDIR)$(hplip_Logdir)
endif #FULL_BUILD
if HPLIP_BUILD
test -z "$(DESTDIR)$(hplip_Logdir)" || mkdir -p $(DESTDIR)$(hplip_Logdir)
chgrp "lp" -R $(DESTDIR)$(hplip_Logdir)
chmod 775 $(DESTDIR)$(hplip_Logdir)
endif #FULL_BUILD
install-dist_hplip_tmpDATA:
if FULL_BUILD
test -z "$(DESTDIR)$(hplip_tmpdir)" || mkdir -p $(DESTDIR)$(hplip_tmpdir)
chgrp "lp" -R $(DESTDIR)$(hplip_tmpdir)
chmod 0775 $(DESTDIR)$(hplip_tmpdir)
endif #FULL_BUILD
if HPLIP_BUILD
test -z "$(DESTDIR)$(hplip_tmpdir)" || mkdir -p $(DESTDIR)$(hplip_tmpdir)
chgrp "lp" -R $(DESTDIR)$(hplip_tmpdir)
chmod 0775 $(DESTDIR)$(hplip_tmpdir)
endif #FULL_BUILD
install-data-hook:
if HPLIP_BUILD
# If scanner build, add hpaio entry to sane dll.conf.
......
This diff is collapsed.
......@@ -159,15 +159,15 @@ class State(ConfigBase):
class UserConfig(ConfigBase):
def __init__(self):
if not os.geteuid() == 0:
prop.user_dir = os.path.expanduser('~/.hplip')
try:
if not os.path.exists(prop.user_dir):
os.makedirs(prop.user_dir)
except OSError:
pass # This is sometimes OK, if running hpfax: for example
prop.user_dir = os.path.expanduser('~/.hplip')
try:
if not os.path.exists(prop.user_dir):
os.makedirs(prop.user_dir)
except OSError:
log.error("Failed to create %s directory. User preferences and collection of debug logs can't be supported."%(prop.user_dir))
if not os.geteuid() == 0:
prop.user_config_file = os.path.join(prop.user_dir, 'hplip.conf')
if not os.path.exists(prop.user_config_file):
......@@ -182,7 +182,6 @@ class UserConfig(ConfigBase):
else:
# If running as root, conf file is None
prop.user_dir = None
prop.user_config_file = None
ConfigBase.__init__(self, None)
......@@ -293,6 +292,7 @@ def cleanup_spinner():
sys.stdout.flush()
# Internal/messaging errors
ERROR_STRINGS = {
......
......@@ -296,7 +296,7 @@ class Logger(object):
def warn(self, message):
if self._level <= Logger.LOG_LEVEL_WARN:
txt = "warning: %s" % message.encode('utf-8')
txt = "warning: %s" % message
self.log(self.color(txt, 'fuscia'), Logger.LOG_LEVEL_WARN)
syslog.syslog(syslog.LOG_WARNING, "%s[%d]: %s" % (self.module, self.pid, txt))
......@@ -322,7 +322,7 @@ class Logger(object):
def error(self, message):
if self._level <= Logger.LOG_LEVEL_ERROR:
txt = "error: %s" % message.encode("utf-8")
txt = "error: %s" % message
self.log(self.color(txt, 'red'), Logger.LOG_LEVEL_ERROR)
syslog.syslog(syslog.LOG_ALERT, "%s[%d]: %s" % (self.module, self.pid, txt))
......@@ -334,7 +334,7 @@ class Logger(object):
def fatal(self, message):
if self._level <= Logger.LOG_LEVEL_FATAL:
txt = "fatal error: :%s" % self.module.encode('utf-8')
txt = "fatal error: :%s" % self
self.log(self.color(txt, 'red'), Logger.LOG_LEVEL_DEBUG)
syslog.syslog(syslog.LOG_ALERT, "%s[%d]: %s" % (self.module, self.pid, txt))
......
......@@ -108,6 +108,7 @@ TECH_CLASSES = [
"Python11",
"Saipan",
"PyramidPlus",
"Hbpl1",
"Kapan",
"MimasTDR",
]
......@@ -166,6 +167,7 @@ TECH_CLASS_PDLS = {
"Copperhead" : 'pcl3',
"Copperhead12" : 'pcl3',
"Ampere" : 'pcl3',
"Hbpl1" : 'hbpl1',
"Kapan" : 'pcl3',
"MimasTDR" : 'pcl3'
}
......
......@@ -24,7 +24,7 @@ import cStringIO
import time
import string
from base import utils, tui
from base import utils, tui, os_utils
from base.g import *
import pexpect
......@@ -56,6 +56,19 @@ AUTH_TYPES ={'mepis':'su',
}
# This function promts for the username and password and returns (username,password)
def showPasswordPrompt(prompt):
import getpass
print ""
print ""
print log.bold(prompt)
username = raw_input("Username: ")
password = getpass.getpass("Password: ")
return (username, password)
#TBD this function shoud be removed once distro class implemented
def get_distro_name():
os_name = None;
......@@ -85,6 +98,13 @@ class Password(object):
self.__mode = Mode
self.__readAuthType() #self.__authType
self.__expectList =[]
if not utils.to_bool(sys_conf.get('configure','qt4', '0')) and utils.to_bool(sys_conf.get('configure','qt3', '0')):
self.__ui_toolkit = 'qt3'
else:
self.__ui_toolkit = 'qt4'
for s in utils.EXPECT_WORD_LIST:
try:
p = re.compile(s, re.I)
......@@ -100,11 +120,13 @@ class Password(object):
#TBD: Getting distro name should get distro class
distro_name = get_distro_name().lower()
try:
self.__authType = AUTH_TYPES[distro_name]
except KeyError:
log.warn("%s distro is not found in AUTH_TYPES"%distro_name)
self.__authType = 'su'
self.__authType = user_conf.get('authentication', 'su_sudo', '')
if self.__authType != "su" and self.__authType != "sudo":
try:
self.__authType = AUTH_TYPES[distro_name]
except KeyError:
log.warn("%s distro is not found in AUTH_TYPES"%distro_name)
self.__authType = 'su'
def __getPasswordDisplayString(self):
if self.__authType == "su":
......@@ -118,6 +140,7 @@ class Password(object):
self.__authType = "su"
else:
self.__authType = "sudo"
user_conf.set('authentication', 'su_sudo', self.__authType)
def __get_password(self,pswd_msg=''):
......@@ -131,19 +154,20 @@ class Password(object):
def __get_password_ui(self,pswd_msg='', qt="qt4"):
def __get_password_ui(self,pswd_msg='', user ="root"):
if pswd_msg == '':
pswd_msg = "Your HP Device requires to install HP proprietary plugin\nPlease enter root/superuser password to continue"
#TBD: currently takes only username as root, need to handle for other users also.
if qt == "qt4":
from ui4.setupdialog import showPasswordUI
username, password = showPasswordUI(pswd_msg, "root", False)