topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday April 26, 2024, 1:47 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - DoXiD [ switch to compact view ]

Pages: [1]
1
Hi!

first off, This application is intended as a tool to gather printer information quickly, not in-depth hard core debugging of bits and bytes.
Secondly, you will need Python for this to work, i will not compile this application cause it's constantly developed and changed.
Thirdly, i cannot be held responsible for anything this code does or be demanded to support it, i will release it as is and give out assistance here in meens of time for free.
(i know the code ain't perfect, and there's probably better tools for this, but this is a light-weight, fast and flexible way to debug information about the printer and it's documents)

The software is released under the original BSD Licens: http://www.openbsd.org/policy.html
The software also requires the library "pywin32": http://sourceforge.n...win32/files/pywin32/

(There are plans to evolve this software to actually dig into the printer and fetch information)

Code: Python [Select]
  1. __author__ = "Anton Hvornum"
  2. __copyright__ = "Copyright 2011, Anton Hvornum under the BSD License"
  3. __credits__ = ["Anton Hvornum"]
  4. __license__ = "BSD License (Original)"
  5. __version__ = "0.0.1"
  6. __maintainer__ = "Anton Hvornum"
  7. __email__ = "[email protected]"
  8. __status__ = "Alpha"
  9.  
  10. import win32print, os
  11.  
  12. wp = win32print
  13. printer_types = [(wp.PRINTER_ENUM_SHARED, 'shared'), (wp.PRINTER_ENUM_LOCAL, 'local'), (wp.PRINTER_ENUM_CONNECTIONS, 'network')]
  14.  
  15. print_directory = wp.GetPrintProcessorDirectory()
  16. if not 'printers' in print_directory:
  17.         print_directory = os.path.normpath(print_directory + '/../../PRINTERS')
  18.  
  19. def get_printer(name = '*'):
  20.         printer_list = {}
  21.         for printer_type in printer_types:
  22.                 print printer_type
  23.                 for printer in win32print.EnumPrinters(printer_type[0],None,1):
  24.                         if name == '*':
  25.                                 printer_list[printer] = win32print.OpenPrinter(printer[2])
  26.                         elif name.lower() in printer[2].lower():
  27.                                 printer_list[printer] = win32print.OpenPrinter(printer[2])
  28.         return printer_list
  29.  
  30. def GetJobList(printer):
  31.         printer_handle = win32print.OpenPrinter(printer)
  32.  
  33.         job_list = win32print.EnumJobs(printer_handle,0,-1,2)
  34.         win32print.ClosePrinter(printer_handle)
  35.  
  36.         return job_list
  37.  
  38. def getJobDetail(printer, id):
  39.         printer_handle = win32print.OpenPrinter(printer)
  40.  
  41.         job_detail = win32print.GetJob(printer_handle,id,2)
  42.         win32print.ClosePrinter(printer_handle)
  43.  
  44.         return job_detail
  45.  
  46. printer_list = get_printer(raw_input('Name of the printer you\'re looking for (blank or * for all): '))
  47.  
  48. for printer in printer_list:
  49.         print 'Joblist for:',printer
  50.         for job in GetJobList(printer[2]):
  51.                 if 'JobId' in job:
  52.                         job_detail = getJobDetail(printer[2], job['JobId'])
  53.                         if not 'file_path' in job_detail:
  54.                                 job_str = '00000'
  55.                                 job_str = job_str[:-len(str(job_detail['JobId']))] + str(job_detail['JobId'])
  56.  
  57.                                 shd_file = os.path.join(str(print_directory), job_str + '.SHD')
  58.                                 spl_file = os.path.join(str(print_directory), job_str + '.SPL')
  59.  
  60.                                 print shd_file
  61.                                 print spl_file
  62.  
  63.                                 if os.path.isfile(shd_file) and os.path.isfile(spl_file):
  64.                                         job_detail['file_path'] = os.path.join(str(print_directory), str(job_detail['JobId']))
  65.                                 else:
  66.                                         job_detail['file_path'] = str(print_directory)
  67.                         for key in job_detail:
  68.                                 print '\t', key, '::', job_detal[key]
  69.                 print ''

2
Mircryption / Blowssi - Perl v5.10.1 - 2/3 subtests failed
« on: April 18, 2011, 02:42 PM »
Hi.

I'm having some issues building blowssi and tbh, i'm no wizzard with Perl.
This is all the information i have and i can only hope for some help here:

OS: Xubuntu 10.10
Perl: v5.10.1
Blowssi: v0.2.0
running as root just to be extra clear here..


This is what i get from "make test" on Crypt-ircDH1080-0.01:
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/Crypt-ircDH1080.t .. 1/2
#   Failed test at t/Crypt-ircDH1080.t line 21.
# Looks like you planned 2 tests but ran 3.
# Looks like you failed 1 test of 3 run.
t/Crypt-ircDH1080.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/2 subtests

Test Summary Report
-------------------
t/Crypt-ircDH1080.t (Wstat: 256 Tests: 3 Failed: 2)
  Failed tests:  2-3
  Non-zero exit status: 1
  Parse errors: Bad plan.  You planned 2 tests but ran 3.
Files=1, Tests=3,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.15 cusr  0.00 csys =  0.17 CPU)
Result: FAIL
Failed 1/1 test programs. 2/3 subtests failed.
make: *** [test_dynamic] Error 1

I ran into some issues with a lot of libraries, like Crypt::Random, doesn't excist in my distro aparently so i took some help from #perl and they gave me these instructions:
curl -L http://cpanmin.us | perl - --sudo App::cpanminus
cpanm -S Crypt::Random
That did the trick for that module, had some others but i simply replaced the dashes in the error message with :: and tried:
cpanm -S <Module::Thing::here> and it worked, and i got this faar.


I'll supply any details you need, i can rerun the entire command history just to get this working tbh.
I'm just so new to Perl so i don't really know what you expect when you debug, if you'd be using Python, C++, C# you name it i'd probably be of more use, so, if you need any info at all, poke me! i'll probably hang around irc for some time hoping for an answer (nick on efnet is Torxed tho)


Thank you in advance from the bottom of my heart!

Pages: [1]