Esempio n. 1
0
        print '\nLogged in to PaperCut with session ID',sessID
        if args.list: list_printers(sessID)
        if args.balance: get_balance(sessID)
        if args.printjob:
            if not args.printer:
                printers = list_printers(sessID)
                args.printer = raw_input('select printer: ')
                try:
                    printerIndex = int(args.printer)
                    args.printer = printers[printerIndex][1]
                except ValueError:
                    pass
                printJobID = papercut.printFile(args.printjob, args.printer, sessID)
                print '\nJob sent to printer', args.printer
                
                status = papercut.getPrintStatus(printJobID)
                while(status['status'] == 'Submitting'):
                    time.sleep(0.1)
                    status = papercut.getPrintStatus(printJobID)
                print "\nJob queued for printing."

                while(not status['complete']):
                    time.sleep(0.1)
                    status = papercut.getPrintStatus(printJobID)
                print "\nComplete!"
                print "\nThis job cost $", status['cost']
#                print status
                get_balance(sessID)
        
    else:
        print '\nDid not successfully log in to PaperCut'
Esempio n. 2
0
        if args.list: list_printers(sessID)
        if args.balance: get_balance(sessID)
        if args.printjob:
            if not args.printer:
                printers = list_printers(sessID)
                args.printer = raw_input('select printer: ')
                try:
                    printerIndex = int(args.printer)
                    args.printer = printers[printerIndex][1]
                except ValueError:
                    pass
                printJobID = papercut.printFile(args.printjob, args.printer,
                                                sessID)
                print '\nJob sent to printer', args.printer

                status = papercut.getPrintStatus(printJobID)
                while (status['status'] == 'Submitting'):
                    time.sleep(0.1)
                    status = papercut.getPrintStatus(printJobID)
                print "\nJob queued for printing."

                while (not status['complete']):
                    time.sleep(0.1)
                    status = papercut.getPrintStatus(printJobID)
                print "\nComplete!"
                print "\nThis job cost $", status['cost']
                #                print status
                get_balance(sessID)

    else:
        print '\nDid not successfully log in to PaperCut'