root / pykota / trunk / pykota / storage.py @ 1365

Revision 1365, 24.0 kB (checked in by jalet, 20 years ago)

Should fix the remaining bugs wrt printers groups and users groups.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1# PyKota
2# -*- coding: ISO-8859-15 -*-
3#
4# PyKota : Print Quotas for CUPS and LPRng
5#
6# (c) 2003-2004 Jerome Alet <alet@librelogiciel.com>
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
20#
21# $Id$
22#
23# $Log$
24# Revision 1.46  2004/02/26 14:18:07  jalet
25# Should fix the remaining bugs wrt printers groups and users groups.
26#
27# Revision 1.45  2004/02/26 10:40:40  jalet
28# Fixed nested printer groups accounting.
29#
30# Revision 1.44  2004/02/25 19:09:24  jalet
31# Fix for LDAP problem when job price was 0.
32#
33# Revision 1.43  2004/02/25 12:36:34  jalet
34# Avoids a database query even if caching was disabled.
35#
36# Revision 1.42  2004/02/23 22:53:21  jalet
37# Don't retrieve data when it's not needed, to avoid database queries
38#
39# Revision 1.41  2004/02/04 17:12:33  jalet
40# Removing a printer from a printers group should work now.
41#
42# Revision 1.40  2004/02/04 13:24:41  jalet
43# pkprinters can now remove printers from printers groups.
44#
45# Revision 1.39  2004/02/04 11:16:59  jalet
46# pkprinters command line tool added.
47#
48# Revision 1.38  2004/01/12 22:43:40  jalet
49# New formula to compute a job's price
50#
51# Revision 1.37  2004/01/12 14:35:01  jalet
52# Printing history added to CGI script.
53#
54# Revision 1.36  2004/01/10 09:44:02  jalet
55# Fixed potential accuracy problem if a user printed on several printers at
56# the very same time.
57#
58# Revision 1.35  2004/01/08 16:33:27  jalet
59# Additionnal check to not create a circular printers group.
60#
61# Revision 1.34  2004/01/08 16:24:49  jalet
62# edpykota now supports adding printers to printer groups.
63#
64# Revision 1.33  2004/01/08 14:10:32  jalet
65# Copyright year changed.
66#
67# Revision 1.32  2004/01/06 16:02:57  jalet
68# This time printer groups caching works.
69#
70# Revision 1.31  2004/01/06 15:51:24  jalet
71# Fixed caching of printer groups
72#
73# Revision 1.30  2004/01/06 14:24:59  jalet
74# Printer groups should be cached now, if caching is enabled.
75#
76# Revision 1.29  2003/12/27 16:49:25  uid67467
77# Should be ok now.
78#
79# Revision 1.28  2003/11/25 23:46:40  jalet
80# Don't try to verify if module name is valid, Python does this better than us.
81#
82# Revision 1.27  2003/11/23 19:01:36  jalet
83# Job price added to history
84#
85# Revision 1.26  2003/11/21 14:28:45  jalet
86# More complete job history.
87#
88# Revision 1.25  2003/10/08 21:12:27  jalet
89# Do not cache anymore entries which don't exist.
90#
91# Revision 1.24  2003/10/07 22:06:05  jalet
92# Preliminary code to disable job history
93#
94# Revision 1.23  2003/10/07 09:07:28  jalet
95# Character encoding added to please latest version of Python
96#
97# Revision 1.22  2003/10/06 13:12:27  jalet
98# More work on caching
99#
100# Revision 1.21  2003/10/03 09:02:20  jalet
101# Logs cache store actions too
102#
103# Revision 1.20  2003/10/02 20:23:18  jalet
104# Storage caching mechanism added.
105#
106# Revision 1.19  2003/07/16 21:53:07  jalet
107# Really big modifications wrt new configuration file's location and content.
108#
109# Revision 1.18  2003/07/07 08:33:18  jalet
110# Bug fix due to a typo in LDAP code
111#
112# Revision 1.17  2003/07/05 07:46:50  jalet
113# The previous bug fix was incomplete.
114#
115# Revision 1.16  2003/06/25 19:52:31  jalet
116# Should be ready for testing :-)
117#
118# Revision 1.15  2003/06/25 14:10:58  jalet
119# Exception raising for now.
120#
121# Revision 1.14  2003/06/25 14:10:01  jalet
122# Hey, it may work (edpykota --reset excepted) !
123#
124# Revision 1.13  2003/06/10 16:37:54  jalet
125# Deletion of the second user which is not needed anymore.
126# Added a debug configuration field in /etc/pykota.conf
127# All queries can now be sent to the logger in debug mode, this will
128# greatly help improve performance when time for this will come.
129#
130# Revision 1.12  2003/04/23 22:13:57  jalet
131# Preliminary support for LPRng added BUT STILL UNTESTED.
132#
133# Revision 1.11  2003/04/10 21:47:20  jalet
134# Job history added. Upgrade script neutralized for now !
135#
136# Revision 1.10  2003/03/29 13:45:27  jalet
137# GPL paragraphs were incorrectly (from memory) copied into the sources.
138# Two README files were added.
139# Upgrade script for PostgreSQL pre 1.01 schema was added.
140#
141# Revision 1.9  2003/02/17 22:55:01  jalet
142# More options can now be set per printer or globally :
143#
144#       admin
145#       adminmail
146#       gracedelay
147#       requester
148#
149# the printer option has priority when both are defined.
150#
151# Revision 1.8  2003/02/17 22:05:50  jalet
152# Storage backend now supports admin and user passwords (untested)
153#
154# Revision 1.7  2003/02/10 12:07:31  jalet
155# Now repykota should output the recorded total page number for each printer too.
156#
157# Revision 1.6  2003/02/09 13:05:43  jalet
158# Internationalization continues...
159#
160# Revision 1.5  2003/02/08 22:39:46  jalet
161# --reset command line option added
162#
163# Revision 1.4  2003/02/08 09:59:59  jalet
164# Added preliminary base class for all storages
165#
166# Revision 1.3  2003/02/05 22:10:29  jalet
167# Typos
168#
169# Revision 1.2  2003/02/05 22:02:22  jalet
170# __import__ statement didn't work as expected
171#
172# Revision 1.1  2003/02/05 21:28:17  jalet
173# Initial import into CVS
174#
175#
176#
177
178class PyKotaStorageError(Exception):
179    """An exception for Quota Storage related stuff."""
180    def __init__(self, message = ""):
181        self.message = message
182        Exception.__init__(self, message)
183    def __repr__(self):
184        return self.message
185    __str__ = __repr__
186       
187class StorageObject :
188    """Object present in the Quota Storage."""
189    def __init__(self, parent) :
190        "Initialize minimal data."""
191        self.parent = parent
192        self.ident = None
193        self.Exists = 0
194       
195class StorageUser(StorageObject) :       
196    """User class."""
197    def __init__(self, parent, name) :
198        StorageObject.__init__(self, parent)
199        self.Name = name
200        self.LimitBy = None
201        self.AccountBalance = None
202        self.LifeTimePaid = None
203        self.Email = None
204       
205    def consumeAccountBalance(self, amount) :     
206        """Consumes an amount of money from the user's account balance."""
207        self.parent.decreaseUserAccountBalance(self, amount)
208        self.AccountBalance = float(self.AccountBalance or 0.0) - amount
209       
210    def setAccountBalance(self, balance, lifetimepaid) :   
211        """Sets the user's account balance in case he pays more money."""
212        self.parent.writeUserAccountBalance(self, balance, lifetimepaid)
213        self.AccountBalance = balance
214        self.LifeTimePaid = lifetimepaid
215       
216    def setLimitBy(self, limitby) :   
217        """Sets the user's limiting factor."""
218        try :
219            limitby = limitby.lower()
220        except AttributeError :   
221            limitby = "quota"
222        if limitby in ["quota", "balance"] :
223            self.parent.writeUserLimitBy(self, limitby)
224            self.LimitBy = limitby
225       
226    def delete(self) :   
227        """Deletes an user from the Quota Storage."""
228        self.parent.beginTransaction()
229        try :
230            self.parent.deleteUser(self)
231        except PyKotaStorageError, msg :   
232            self.parent.rollbackTransaction()
233            raise PyKotaStorageError, msg
234        else :   
235            self.parent.commitTransaction()
236       
237class StorageGroup(StorageObject) :       
238    """User class."""
239    def __init__(self, parent, name) :
240        StorageObject.__init__(self, parent)
241        self.Name = name
242        self.LimitBy = None
243        self.AccountBalance = None
244        self.LifeTimePaid = None
245       
246    def setLimitBy(self, limitby) :   
247        """Sets the user's limiting factor."""
248        try :
249            limitby = limitby.lower()
250        except AttributeError :   
251            limitby = "quota"
252        if limitby in ["quota", "balance"] :
253            self.parent.writeGroupLimitBy(self, limitby)
254            self.LimitBy = limitby
255       
256    def delete(self) :   
257        """Deletes a group from the Quota Storage."""
258        self.parent.beginTransaction()
259        try :
260            self.parent.deleteGroup(self)
261        except PyKotaStorageError, msg :   
262            self.parent.rollbackTransaction()
263            raise PyKotaStorageError, msg
264        else :   
265            self.parent.commitTransaction()
266       
267class StoragePrinter(StorageObject) :
268    """Printer class."""
269    def __init__(self, parent, name) :
270        StorageObject.__init__(self, parent)
271        self.Name = name
272        self.PricePerPage = None
273        self.PricePerJob = None
274       
275    def __getattr__(self, name) :   
276        """Delays data retrieval until it's really needed."""
277        if name == "LastJob" : 
278            self.LastJob = self.parent.getPrinterLastJob(self)
279            return self.LastJob
280        else :
281            raise AttributeError, name
282           
283    def addJobToHistory(self, jobid, user, pagecounter, action, jobsize=None, jobprice=None, filename=None, title=None, copies=None, options=None) :
284        """Adds a job to the printer's history."""
285        self.parent.writeJobNew(self, user, jobid, pagecounter, action, jobsize, jobprice, filename, title, copies, options)
286        # TODO : update LastJob object ? Probably not needed.
287       
288    def addPrinterToGroup(self, printer) :   
289        """Adds a printer to a printer group."""
290        if (printer not in self.parent.getParentPrinters(self)) and (printer.ident != self.ident) :
291            self.parent.writePrinterToGroup(self, printer)
292            # TODO : reset cached value for printer parents, or add new parent to cached value
293           
294    def delPrinterFromGroup(self, printer) :   
295        """Deletes a printer from a printer group."""
296        self.parent.removePrinterFromGroup(self, printer)
297        # TODO : reset cached value for printer parents, or add new parent to cached value
298       
299    def setPrices(self, priceperpage = None, priceperjob = None) :   
300        """Sets the printer's prices."""
301        if priceperpage is None :
302            priceperpage = self.PricePerPage
303        else :   
304            self.PricePerPage = float(priceperpage)
305        if priceperjob is None :   
306            priceperjob = self.PricePerJob
307        else :   
308            self.PricePerJob = float(priceperjob)
309        self.parent.writePrinterPrices(self)
310       
311    def delete(self) :   
312        """Deletes a printer from the Quota Storage."""
313        self.parent.beginTransaction()
314        try :
315            self.parent.deletePrinter(self)
316        except PyKotaStorageError, msg :   
317            self.parent.rollbackTransaction()
318            raise PyKotaStorageError, msg
319        else :   
320            self.parent.commitTransaction()
321       
322class StorageUserPQuota(StorageObject) :
323    """User Print Quota class."""
324    def __init__(self, parent, user, printer) :
325        StorageObject.__init__(self, parent)
326        self.User = user
327        self.Printer = printer
328        self.PageCounter = None
329        self.LifePageCounter = None
330        self.SoftLimit = None
331        self.HardLimit = None
332        self.DateLimit = None
333       
334    def __getattr__(self, name) :   
335        """Delays data retrieval until it's really needed."""
336        if name == "ParentPrintersUserPQuota" : 
337            self.ParentPrintersUserPQuota = (self.User.Exists and self.Printer.Exists and self.parent.getParentPrintersUserPQuota(self)) or []
338            return self.ParentPrintersUserPQuota
339        else :
340            raise AttributeError, name
341       
342    def setDateLimit(self, datelimit) :   
343        """Sets the date limit for this quota."""
344        date = "%04i-%02i-%02i %02i:%02i:%02i" % (datelimit.year, datelimit.month, datelimit.day, datelimit.hour, datelimit.minute, datelimit.second)
345        self.parent.writeUserPQuotaDateLimit(self, date)
346        self.DateLimit = date
347       
348    def setLimits(self, softlimit, hardlimit) :   
349        """Sets the soft and hard limit for this quota."""
350        self.parent.writeUserPQuotaLimits(self, softlimit, hardlimit)
351        self.SoftLimit = softlimit
352        self.HardLimit = hardlimit
353       
354    def reset(self) :   
355        """Resets page counter to 0."""
356        self.parent.writeUserPQuotaPagesCounters(self, 0, int(self.LifePageCounter or 0))
357        self.PageCounter = 0
358       
359    def computeJobPrice(self, jobsize) :   
360        """Computes the job price as the sum of all parent printers' prices + current printer's ones."""
361        totalprice = 0.0   
362        if jobsize :
363            for upq in [ self ] + self.ParentPrintersUserPQuota :
364                price = (float(upq.Printer.PricePerPage or 0.0) * jobsize) + float(upq.Printer.PricePerJob or 0.0)
365                totalprice += price
366        return totalprice   
367           
368    def increasePagesUsage(self, jobsize) :
369        """Increase the value of used pages and money."""
370        jobprice = self.computeJobPrice(jobsize)
371        if jobsize :
372            self.parent.beginTransaction()
373            try :
374                if jobprice :
375                    self.User.consumeAccountBalance(jobprice)
376                for upq in [ self ] + self.ParentPrintersUserPQuota :
377                    self.parent.increaseUserPQuotaPagesCounters(upq, jobsize)
378                    upq.PageCounter = int(upq.PageCounter or 0) + jobsize
379                    upq.LifePageCounter = int(upq.LifePageCounter or 0) + jobsize
380            except PyKotaStorageError, msg :   
381                self.parent.rollbackTransaction()
382                raise PyKotaStorageError, msg
383            else :   
384                self.parent.commitTransaction()
385        return jobprice
386       
387class StorageGroupPQuota(StorageObject) :
388    """Group Print Quota class."""
389    def __init__(self, parent, group, printer) :
390        StorageObject.__init__(self, parent)
391        self.Group = group
392        self.Printer = printer
393        self.PageCounter = None
394        self.LifePageCounter = None
395        self.SoftLimit = None
396        self.HardLimit = None
397        self.DateLimit = None
398       
399    def __getattr__(self, name) :   
400        """Delays data retrieval until it's really needed."""
401        if name == "ParentPrintersGroupPQuota" : 
402            self.ParentPrintersGroupPQuota = (self.Group.Exists and self.Printer.Exists and self.parent.getParentPrintersGroupPQuota(self)) or []
403            return self.ParentPrintersGroupPQuota
404        else :
405            raise AttributeError, name
406       
407    def setDateLimit(self, datelimit) :   
408        """Sets the date limit for this quota."""
409        date = "%04i-%02i-%02i %02i:%02i:%02i" % (datelimit.year, datelimit.month, datelimit.day, datelimit.hour, datelimit.minute, datelimit.second)
410        self.parent.writeGroupPQuotaDateLimit(self, date)
411        self.DateLimit = date
412       
413    def setLimits(self, softlimit, hardlimit) :   
414        """Sets the soft and hard limit for this quota."""
415        self.parent.writeGroupPQuotaLimits(self, softlimit, hardlimit)
416        self.SoftLimit = softlimit
417        self.HardLimit = hardlimit
418       
419class StorageJob(StorageObject) :
420    """Printer's Last Job class."""
421    def __init__(self, parent) :
422        StorageObject.__init__(self, parent)
423        self.UserName = None
424        self.PrinterName = None
425        self.JobId = None
426        self.PrinterPageCounter = None
427        self.JobSize = None
428        self.JobAction = None
429        self.JobDate = None
430        self.JobPrice = None
431        self.JobFileName = None
432        self.JobTitle = None
433        self.JobCopies = None
434        self.JobOptions = None
435       
436    def __getattr__(self, name) :   
437        """Delays data retrieval until it's really needed."""
438        if name == "User" : 
439            self.User = self.parent.getUser(self.UserName)
440            return self.User
441        elif name == "Printer" :   
442            self.Printer = self.parent.getPrinter(self.PrinterName)
443            return self.Printer
444        else :
445            raise AttributeError, name
446       
447class StorageLastJob(StorageJob) :
448    """Printer's Last Job class."""
449    def __init__(self, parent, printer) :
450        StorageJob.__init__(self, parent)
451        self.PrinterName = printer.Name # not needed
452        self.Printer = printer
453       
454    def __getattr__(self, name) :   
455        """Delays data retrieval until it's really needed."""
456        if name == "User" : 
457            self.User = self.parent.getUser(self.UserName)
458            return self.User
459        else :   
460            raise AttributeError, name
461       
462    def setSize(self, userpquota, jobsize) :
463        """Sets the last job's size."""
464        jobprice = userpquota.computeJobPrice(jobsize)
465        self.parent.writeLastJobSize(self, jobsize, jobprice)
466        self.JobSize = jobsize
467        self.JobPrice = jobprice
468       
469class BaseStorage :
470    def __init__(self, pykotatool) :
471        """Opens the LDAP connection."""
472        # raise PyKotaStorageError, "Sorry, the LDAP backend for PyKota is not yet implemented !"
473        self.closed = 1
474        self.tool = pykotatool
475        self.usecache = pykotatool.config.getCaching()
476        self.disablehistory = pykotatool.config.getDisableHistory()
477        if self.usecache :
478            self.tool.logdebug("Caching enabled.")
479            self.caches = { "USERS" : {}, "GROUPS" : {}, "PRINTERS" : {}, "USERPQUOTAS" : {}, "GROUPPQUOTAS" : {}, "JOBS" : {}, "LASTJOBS" : {} }
480       
481    def close(self) :   
482        """Must be overriden in children classes."""
483        raise RuntimeError, "BaseStorage.close() must be overriden !"
484       
485    def __del__(self) :       
486        """Ensures that the database connection is closed."""
487        self.close()
488       
489    def getFromCache(self, cachetype, key) :
490        """Tries to extract something from the cache."""
491        if self.usecache :
492            entry = self.caches[cachetype].get(key)
493            if entry is not None :
494                self.tool.logdebug("Cache hit (%s->%s)" % (cachetype, key))
495            else :   
496                self.tool.logdebug("Cache miss (%s->%s)" % (cachetype, key))
497            return entry   
498           
499    def cacheEntry(self, cachetype, key, value) :       
500        """Puts an entry in the cache."""
501        if self.usecache and getattr(value, "Exists", 0) :
502            self.caches[cachetype][key] = value
503            self.tool.logdebug("Cache store (%s->%s)" % (cachetype, key))
504           
505    def getUser(self, username) :       
506        """Returns the user from cache."""
507        user = self.getFromCache("USERS", username)
508        if user is None :
509            user = self.getUserFromBackend(username)
510            self.cacheEntry("USERS", username, user)
511        return user   
512       
513    def getGroup(self, groupname) :       
514        """Returns the group from cache."""
515        group = self.getFromCache("GROUPS", groupname)
516        if group is None :
517            group = self.getGroupFromBackend(groupname)
518            self.cacheEntry("GROUPS", groupname, group)
519        return group   
520       
521    def getPrinter(self, printername) :       
522        """Returns the printer from cache."""
523        printer = self.getFromCache("PRINTERS", printername)
524        if printer is None :
525            printer = self.getPrinterFromBackend(printername)
526            self.cacheEntry("PRINTERS", printername, printer)
527        return printer   
528       
529    def getUserPQuota(self, user, printer) :       
530        """Returns the user quota information from cache."""
531        useratprinter = "%s@%s" % (user.Name, printer.Name)
532        upquota = self.getFromCache("USERPQUOTAS", useratprinter)
533        if upquota is None :
534            upquota = self.getUserPQuotaFromBackend(user, printer)
535            self.cacheEntry("USERPQUOTAS", useratprinter, upquota)
536        return upquota   
537       
538    def getGroupPQuota(self, group, printer) :       
539        """Returns the group quota information from cache."""
540        groupatprinter = "%s@%s" % (group.Name, printer.Name)
541        gpquota = self.getFromCache("GROUPPQUOTAS", groupatprinter)
542        if gpquota is None :
543            gpquota = self.getGroupPQuotaFromBackend(group, printer)
544            self.cacheEntry("GROUPPQUOTAS", groupatprinter, gpquota)
545        return gpquota   
546       
547    def getPrinterLastJob(self, printer) :       
548        """Extracts last job information for a given printer from cache."""
549        lastjob = self.getFromCache("LASTJOBS", printer.Name)
550        if lastjob is None :
551            lastjob = self.getPrinterLastJobFromBackend(printer)
552            self.cacheEntry("LASTJOBS", printer.Name, lastjob)
553        return lastjob   
554       
555    def getParentPrinters(self, printer) :   
556        """Extracts parent printers information for a given printer from cache."""
557        if self.usecache :
558            if not hasattr(printer, "Parents") :
559                self.tool.logdebug("Cache miss (%s->Parents)" % printer.Name)
560                printer.Parents = self.getParentPrintersFromBackend(printer)
561                self.tool.logdebug("Cache store (%s->Parents)" % printer.Name)
562            else :
563                self.tool.logdebug("Cache hit (%s->Parents)" % printer.Name)
564        else :       
565            printer.Parents = self.getParentPrintersFromBackend(printer)
566        for parent in printer.Parents[:] :   
567            printer.Parents.extend(self.getParentPrinters(parent))
568        return printer.Parents
569       
570    def getGroupMembers(self, group) :       
571        """Returns the group's members list from in-group cache."""
572        if self.usecache :
573            if not hasattr(group, "Members") :
574                self.tool.logdebug("Cache miss (%s->Members)" % group.Name)
575                group.Members = self.getGroupMembersFromBackend(group)
576                self.tool.logdebug("Cache store (%s->Members)" % group.Name)
577            else :
578                self.tool.logdebug("Cache hit (%s->Members)" % group.Name)
579        else :       
580            group.Members = self.getGroupMembersFromBackend(group)
581        return group.Members   
582       
583    def getUserGroups(self, user) :       
584        """Returns the user's groups list from in-user cache."""
585        if self.usecache :
586            if not hasattr(user, "Groups") :
587                self.tool.logdebug("Cache miss (%s->Groups)" % user.Name)
588                user.Groups = self.getUserGroupsFromBackend(user)
589                self.tool.logdebug("Cache store (%s->Groups)" % user.Name)
590            else :
591                self.tool.logdebug("Cache hit (%s->Groups)" % user.Name)
592        else :       
593            user.Groups = self.getUserGroupsFromBackend(user)
594        return user.Groups   
595       
596    def getParentPrintersUserPQuota(self, userpquota) :     
597        """Returns all user print quota on the printer and all its parents recursively."""
598        upquotas = [ ]
599        for printer in self.getParentPrinters(userpquota.Printer) :
600            upquotas.append(self.getUserPQuota(userpquota.User, printer))
601        return upquotas       
602       
603    def getParentPrintersGroupPQuota(self, grouppquota) :     
604        """Returns all group print quota on the printer and all its parents recursively."""
605        gpquotas = [ ]
606        for printer in self.getParentPrinters(grouppquota.Printer) :
607            gpquotas.append(self.getGroupPQuota(grouppquota.Group, printer))
608        return gpquotas       
609       
610def openConnection(pykotatool) :
611    """Returns a connection handle to the appropriate Quota Storage Database."""
612    backendinfo = pykotatool.config.getStorageBackend()
613    backend = backendinfo["storagebackend"]
614    try :
615        exec "from pykota.storages import %s as storagebackend" % backend.lower()
616    except ImportError :
617        raise PyKotaStorageError, _("Unsupported quota storage backend %s") % backend
618    else :   
619        host = backendinfo["storageserver"]
620        database = backendinfo["storagename"]
621        admin = backendinfo["storageadmin"] or backendinfo["storageuser"]
622        adminpw = backendinfo["storageadminpw"] or backendinfo["storageuserpw"]
623        return storagebackend.Storage(pykotatool, host, database, admin, adminpw)
Note: See TracBrowser for help on using the browser.