コード例 #1
0
ファイル: cups.py プロジェクト: thnguyn2/ECE_527_MP
def addPrinter(printer_name, device_uri, location, ppd_file, model, info):
    log.debug("addPrinter('%s', '%s', '%s', '%s', '%s', '%s')" %
        ( printer_name, device_uri, location, ppd_file, model, info))

    if ppd_file and not os.path.exists(ppd_file):
        log.error("PPD file '%s' not found." % ppd_file)
        return (-1, "PPD file not found")

    return cupsext.addPrinter(printer_name, device_uri, location, ppd_file, model, info)
コード例 #2
0
def addPrinter(printer_name, device_uri, location, ppd_file, model, info):
    log.debug("addPrinter('%s', '%s', '%s', '%s', '%s', '%s')" %
        ( printer_name, device_uri, location, ppd_file, model, info))

    if ppd_file and not os.path.exists(ppd_file):
        log.error("PPD file '%s' not found." % ppd_file)
        return (-1, "PPD file not found")

    return cupsext.addPrinter(printer_name, device_uri, location, ppd_file, model, info)
コード例 #3
0
ファイル: cups.py プロジェクト: incrazyboyy/RPiTC-X
def addPrinter(printer_name, device_uri, location, ppd_file, model, info):
    setPasswordPrompt("You do not have permission to add a printer. You need authentication.")
    log.debug("addPrinter('%s', '%s', '%s', '%s', '%s', '%s')" %
        ( printer_name, device_uri, location, ppd_file, model, info))

    if ppd_file and not os.path.exists(ppd_file):
        log.error("PPD file '%s' not found." % ppd_file)
        return (-1, "PPD file not found")

    return cupsext.addPrinter(printer_name, device_uri, location, ppd_file, model, info)
コード例 #4
0
ファイル: cups.py プロジェクト: jpopelka/hplip
def addPrinter(printer_name, device_uri, location, ppd_file, model, info):
    setPasswordPrompt("You do not have permission to add a printer. You need authentication.")
    log.debug("addPrinter('%s', '%s', '%s', '%s', '%s', '%s')" %
        ( printer_name, device_uri, location, ppd_file, model, info))

    if ppd_file and not os.path.exists(ppd_file):
        log.error("PPD file '%s' not found." % ppd_file)
        return (-1, "PPD file not found")

    return cupsext.addPrinter(printer_name, device_uri, location, ppd_file, model, info)