Index: /pykota/trunk/setup.py
===================================================================
--- /pykota/trunk/setup.py (revision 1592)
+++ /pykota/trunk/setup.py (revision 1595)
@@ -24,4 +24,7 @@
 #
 # $Log$
+# Revision 1.46  2004/07/07 13:21:26  jalet
+# Introduction of the pykosd command
+#
 # Revision 1.45  2004/07/06 09:37:01  jalet
 # Integrated most of the Debian packaging work made by Sergio Gonz�z Gonz�z
@@ -459,5 +462,5 @@
       url = "http://www.librelogiciel.com/software/",
       packages = [ "pykota", "pykota.storages", "pykota.loggers", "pykota.accounters", "pykota.reporters" ],
-      scripts = [ "bin/pkpgcounter", "bin/snmpprinterstatus", "bin/edpykota", "bin/repykota", "bin/warnpykota", "bin/pykotme", "bin/pkprinters", "bin/pkhint" ],
+      scripts = [ "bin/pkpgcounter", "bin/snmpprinterstatus", "bin/pykosd", "bin/edpykota", "bin/repykota", "bin/warnpykota", "bin/pykotme", "bin/pkprinters", "bin/pkhint" ],
       data_files = data_files)
 
Index: /pykota/trunk/bin/pykosd
===================================================================
--- /pykota/trunk/bin/pykosd (revision 1595)
+++ /pykota/trunk/bin/pykosd (revision 1595)
@@ -0,0 +1,64 @@
+#! /usr/bin/env python
+# -*- coding: ISO-8859-15 -*-
+
+# PyKota Print Quota Editor 
+#
+# PyKota - Print Quotas for CUPS and LPRng
+#
+# (c) 2003-2004 Jerome Alet <alet@librelogiciel.com>
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+#
+# $Id$
+#
+# $Log$
+# Revision 1.1  2004/07/07 13:21:27  jalet
+# Introduction of the pykosd command
+#
+#
+#
+
+import sys
+import os
+import pwd
+import time
+import pyosd
+
+from pykota.tool import PyKotaTool, PyKotaToolError, crashed
+
+if __name__ == "__main__" :
+    retcode = -1
+    try :
+        cmd = PyKotaTool(doc="A tool to display remaining print units")
+    except :    
+        crashed("Initialization problem.")
+    else :    
+        try :
+            uid = os.geteuid()
+            uname = pwd.getpwuid(uid)[0]
+            user = cmd.storage.getUser(uname)
+            if not user.Exists :
+                raise PyKotaToolError, "User %s doesn't exist in PyKota's database." % uname
+            display = pyosd.osd(colour="#FF0000", timeout=5, shadow=2)
+            display.display("PyKota Units left : %.2f" % user.AccountBalance, type=pyosd.TYPE_STRING)    
+            time.sleep(6)
+        except :
+            cmd.crashed("Strange problem : please report it ASAP to alet@librelogiciel.com")
+        else :
+            retcode = 0
+        try :
+            cmd.storage.close()
+        except :    
+            pass
+    sys.exit(retcode)
Index: /pykota/trunk/MANIFEST.in
===================================================================
--- /pykota/trunk/MANIFEST.in (revision 1590)
+++ /pykota/trunk/MANIFEST.in (revision 1595)
@@ -1,3 +1,3 @@
-include README FAQ COPYING LICENSE TODO NEWS CREDITS SECURITY MANIFEST.in clean.sh bin/cupspykota bin/edpykota bin/warnpykota bin/repykota bin/pykotme bin/pkprinters bin/pkhint bin/pkpgcounter bin/snmpprinterstatus bin/waitprinter.sh bin/papwaitprinter.sh bin/mailandpopup.sh bin/README
+include README FAQ COPYING LICENSE TODO NEWS CREDITS SECURITY MANIFEST.in clean.sh bin/cupspykota bin/edpykota bin/warnpykota bin/repykota bin/pykotme bin/pykosd bin/pkprinters bin/pkhint bin/pkpgcounter bin/snmpprinterstatus bin/waitprinter.sh bin/papwaitprinter.sh bin/mailandpopup.sh bin/README
 recursive-include po README *.po *.mo *.pot
 recursive-include man README *.sh *.1
Index: /pykota/trunk/NEWS
===================================================================
--- /pykota/trunk/NEWS (revision 1593)
+++ /pykota/trunk/NEWS (revision 1595)
@@ -24,4 +24,6 @@
     - 1.19alpha30 :
     
+        - Introduction of preliminary version of the pykosd command
+        
         - Usernames, Groupnames and Printernames can now contain
           ANY character, expected '/' and '@'.
