def __init__(self, parent): QWidget.__init__(self, parent) self.parent = parent self.initUi() self.file_list = [] self.typ = FILETABLE_TYPE_PRINT self.selected_filename = None self.fax_add_callback = None self.allowable_mime_types = cups.getAllowableMIMETypes() self.user_settings = UserSettings() self.user_settings.load() self.user_settings.debug() self.working_dir = self.user_settings.working_dir #user_conf.workingDirectory()
def __init__(self, parent): QWidget.__init__(self, parent) self.parent = parent self.initUi() self.file_list = [] self.typ = FILETABLE_TYPE_PRINT self.selected_filename = None self.fax_add_callback = None self.allowable_mime_types = cups.getAllowableMIMETypes() self.user_settings = UserSettings() self.user_settings.load() self.user_settings.debug() self.working_dir = self.user_settings.working_dir # user_conf.workingDirectory()
def __init__(self, service, parent=None, form=None, name=None, fl=0): ScrollView.__init__(self, service, parent, name, fl) self.initJobStorage() self.form = form self.file_list = [] self.pages_button_group = 0 self.prev_selected_file_index = 0 self.allowable_mime_types = cups.getAllowableMIMETypes() log.debug(self.allowable_mime_types) self.MIME_TYPES_DESC = \ { "application/pdf" : (self.__tr("PDF Document"), '.pdf'), "application/postscript" : (self.__tr("Postscript Document"), '.ps'), "application/vnd.hp-HPGL" : (self.__tr("HP Graphics Language File"), '.hgl, .hpg, .plt, .prn'), "application/x-cshell" : (self.__tr("C Shell Script"), '.csh, .sh'), "application/x-csource" : (self.__tr("C Source Code"), '.c'), "text/cpp": (self.__tr("C++ Source Code"), '.cpp, .cxx'), "application/x-perl" : (self.__tr("Perl Script"), '.pl'), "application/x-python" : (self.__tr("Python Program"), '.py'), "application/x-shell" : (self.__tr("Shell Script"), '.sh'), "application/x-sh" : (self.__tr("Shell Script"), '.sh'), "text/plain" : (self.__tr("Plain Text"), '.txt, .log, etc'), "text/html" : (self.__tr("HTML Dcoument"), '.htm, .html'), "image/gif" : (self.__tr("GIF Image"), '.gif'), "image/png" : (self.__tr("PNG Image"), '.png'), "image/jpeg" : (self.__tr("JPEG Image"), '.jpg, .jpeg'), "image/tiff" : (self.__tr("TIFF Image"), '.tif, .tiff'), "image/x-bitmap" : (self.__tr("Bitmap (BMP) Image"), '.bmp'), "image/x-bmp" : (self.__tr("Bitmap (BMP) Image"), '.bmp'), "image/x-photocd" : (self.__tr("Photo CD Image"), '.pcd'), "image/x-portable-anymap" : (self.__tr("Portable Image (PNM)"), '.pnm'), "image/x-portable-bitmap" : (self.__tr("Portable B&W Image (PBM)"), '.pbm'), "image/x-portable-graymap" : (self.__tr("Portable Grayscale Image (PGM)"), '.pgm'), "image/x-portable-pixmap" : (self.__tr("Portable Color Image (PPM)"), '.ppm'), "image/x-sgi-rgb" : (self.__tr("SGI RGB"), '.rgb'), "image/x-xbitmap" : (self.__tr("X11 Bitmap (XBM)"), '.xbm'), "image/x-xpixmap" : (self.__tr("X11 Pixmap (XPM)"), '.xpm'), "image/x-sun-raster" : (self.__tr("Sun Raster Format"), '.ras'), }
for p in recipient_list: a = db.get(p) if a['fax']: phone_num_list.append(a) log.debug("Name=%s Number=%s" % (a['name'], a['fax'])) for p in faxnum_list: phone_num_list.append({'fax': p, 'name': to_unicode('Unknown')}) log.debug("Number=%s" % p) log.debug("Phone num list = %s" % phone_num_list) if not phone_num_list: mod.usage(error_msg=["No recipients specified. Please use -f, -r, and/or -g to specify recipients."]) allowable_mime_types = cups.getAllowableMIMETypes() # stat = '' # try : # p = subprocess.Popen('getenforce', stdout=subprocess.PIPE, stderr=subprocess.PIPE) # stat, err = p.communicate() # stat = to_string_utf8(stat) # except OSError : # pass # except : # log.exception() # sys.exit(1) # if stat.strip('\n') == 'Enforcing' : # log.error('Unable to add file. Please disable SeLinux.\nEither disable it manually or run hp-doctor from terminal.') # sys.exit(0)
def __init__(self, service, parent = None, form=None, name = None,fl = 0): ScrollView.__init__(self, service, parent, name, fl) global fax_enabled if service is None: fax_enabled = False self.form = form self.file_list = [] self.pages_button_group = 0 self.recipient_list = [] self.username = prop.username self.busy = False self.allowable_mime_types = cups.getAllowableMIMETypes() self.cover_page_func, cover_page_png = None, None self.cover_page_message = '' self.cover_page_re = '' self.cover_page_name = '' self.update_queue = queue.Queue() # UI updates from send thread self.event_queue = queue.Queue() # UI events (cancel) to send thread self.prev_selected_file_path = '' self.prev_selected_recipient = '' self.preserve_formatting = False self.waitdlg = None log.debug(self.allowable_mime_types) self.last_job_id = 0 self.dev = None self.lock_file = None self.db = fax.FaxAddressBook() self.last_db_modification = self.db.last_modification_time() self.MIME_TYPES_DESC = \ { "application/pdf" : (self.__tr("PDF Document"), '.pdf'), "application/postscript" : (self.__tr("Postscript Document"), '.ps'), "application/vnd.hp-HPGL" : (self.__tr("HP Graphics Language File"), '.hgl, .hpg, .plt, .prn'), "application/x-cshell" : (self.__tr("C Shell Script"), '.csh, .sh'), "application/x-csource" : (self.__tr("C Source Code"), '.c'), "text/cpp": (self.__tr("C++ Source Code"), '.cpp, .cxx'), "application/x-perl" : (self.__tr("Perl Script"), '.pl'), "application/x-python" : (self.__tr("Python Program"), '.py'), "application/x-shell" : (self.__tr("Shell Script"), '.sh'), "application/x-sh" : (self.__tr("Shell Script"), '.sh'), "text/plain" : (self.__tr("Plain Text"), '.txt, .log, etc'), "text/html" : (self.__tr("HTML Dcoument"), '.htm, .html'), "image/gif" : (self.__tr("GIF Image"), '.gif'), "image/png" : (self.__tr("PNG Image"), '.png'), "image/jpeg" : (self.__tr("JPEG Image"), '.jpg, .jpeg'), "image/tiff" : (self.__tr("TIFF Image"), '.tif, .tiff'), "image/x-bitmap" : (self.__tr("Bitmap (BMP) Image"), '.bmp'), "image/x-bmp" : (self.__tr("Bitmap (BMP) Image"), '.bmp'), "image/x-photocd" : (self.__tr("Photo CD Image"), '.pcd'), "image/x-portable-anymap" : (self.__tr("Portable Image (PNM)"), '.pnm'), "image/x-portable-bitmap" : (self.__tr("Portable B&W Image (PBM)"), '.pbm'), "image/x-portable-graymap" : (self.__tr("Portable Grayscale Image (PGM)"), '.pgm'), "image/x-portable-pixmap" : (self.__tr("Portable Color Image (PPM)"), '.ppm'), "image/x-sgi-rgb" : (self.__tr("SGI RGB"), '.rgb'), "image/x-xbitmap" : (self.__tr("X11 Bitmap (XBM)"), '.xbm'), "image/x-xpixmap" : (self.__tr("X11 Pixmap (XPM)"), '.xpm'), "image/x-sun-raster" : (self.__tr("Sun Raster Format"), '.ras'), } user_settings = utils.UserSettings() self.cmd_fab = user_settings.cmd_fab log.debug("FAB command: %s" % self.cmd_fab) if fax_enabled: self.check_timer = QTimer(self, "CheckTimer") self.connect(self.check_timer, SIGNAL('timeout()'), self.PeriodicCheck) self.check_timer.start(3000)