changeset 26:20f6df6d3f42

- Fix for empty printer list - Updated to 0.0.4a - Altered to use pip
author Ben Croston <ben@croston.org>
date Sat, 16 Nov 2013 17:17:15 +0000
parents fc1a7cf3f92c
children 7c132e01c281
files INSTALL LICENCE README setup.py zebra.py
diffstat 5 files changed, 17 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/INSTALL	Wed Aug 31 16:46:48 2011 +0100
+++ b/INSTALL	Sat Nov 16 17:17:15 2013 +0000
@@ -1,4 +1,5 @@
-python setup.py install
-  or
-python3 setup.py install
+To install, use pip:
+  $ pip install zebra
 
+If an alpha version is required:
+  $ pip install --pre zebra
--- a/LICENCE	Wed Aug 31 16:46:48 2011 +0100
+++ b/LICENCE	Sat Nov 16 17:17:15 2013 +0000
@@ -1,4 +1,4 @@
-Copyright (c) 2011 Ben Croston
+Copyright (c) 2011-2013 Ben Croston
 
 Permission is hereby granted, free of charge, to any person obtaining a copy of
 this software and associated documentation files (the "Software"), to deal in
--- a/README	Wed Aug 31 16:46:48 2011 +0100
+++ b/README	Sat Nov 16 17:17:15 2013 +0000
@@ -1,5 +1,5 @@
 ============
-Zebra-0.0.3a
+Zebra-0.0.4a
 ============
 
 Usage:
@@ -36,3 +36,4 @@
 - On Mac and *nix, install the printer as a Raw printer, not a Zebra one.
 If you are on a Linux or MacOSX machine using CUPS, you may need to set up a
 printer queue using the admin panel at http://localhost:631
+
--- a/setup.py	Wed Aug 31 16:46:48 2011 +0100
+++ b/setup.py	Sat Nov 16 17:17:15 2013 +0000
@@ -20,16 +20,12 @@
 long_description = open('README').read()
 
 if sys.platform.lower().startswith('win'):
-    requires = ['win32print']
-    try:
-        import win32print
-    except:
-        raise Exception('Requires the win32print module from the pywin32 package.\nDownload from http://pypi.python.org/pypi/pywin32/')
+    install_requires = 'win32print'
 else:
-    requires = []
+    install_requires = None
 
 setup(name             = 'zebra',
-      version          = '0.0.3a',
+      version          = '0.0.4a',
       py_modules       = ['zebra'],
       author           = 'Ben Croston',
       author_email     = 'ben@croston.org',
@@ -42,6 +38,6 @@
       classifiers      = classifiers,
       license          = 'MIT',
       cmdclass         = {'build_py': build_py},
-      requires         = requires,
+      install_requires = install_requires
       )
 
--- a/zebra.py	Wed Aug 31 16:46:48 2011 +0100
+++ b/zebra.py	Sat Nov 16 17:17:15 2013 +0000
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-# Copyright (c) 2011 Ben Croston
+# Copyright (c) 2011-2013 Ben Croston
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy of
 # this software and associated documentation files (the "Software"), to deal in
@@ -60,7 +60,7 @@
                 win32print.EndDocPrinter(hPrinter)
         finally:
             win32print.ClosePrinter(hPrinter)
-    
+
     def output(self, commands):
         """Output EPL2 commands to the label printer
 
@@ -79,7 +79,10 @@
 
     def _getqueues_unix(self):
         queues = []
-        output = subprocess.check_output(['lpstat','-p'], universal_newlines=True)
+        try:
+            output = subprocess.check_output(['lpstat','-p'], universal_newlines=True)
+        except subprocess.CalledProcessError:
+            return []
         for line in output.split('\n'):
             if line.startswith('printer'):
                 queues.append(line.split(' ')[1])