Changeset 6350


Ignore:
Timestamp:
Feb 16, 2009, 4:46:16 PM (15 years ago)
Author:
rwilson
Message:

Clean up. Still has problems, but is usable. Will not work with matplotlib_0.98.5.2!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • misc/tools/plotcsv/plotcsv.py

    r6348 r6350  
    157157
    158158class Config(object):
    159     """
    160     An object that behaves like a dictionary but is persistent:
     159    """An object that behaves like a dictionary but is persistent:
    161160
    162161        cfg = Config('filename')
     
    170169
    171170    def __init__(self, configfile=None):
    172         """
    173         __init__(self, String filename=None) -> Config
    174         """
     171        """__init__(self, String filename=None) -> Config"""
    175172
    176173        self.delconf = False
     
    194191
    195192    def __setitem__(self, key, value):
    196         """
    197         Override to allow: cfg[<key>] = <value>
    198         """
     193        """Override to allow: cfg[<key>] = <value>"""
     194       
    199195        self.cfgdict[key] = value
    200196        self.changed = True
    201197
    202198    def __getitem__(self, key):
    203         """
    204         Override to allow: <var> = cfg[<key>]
    205         """
     199        """Override to allow: <var> = cfg[<key>]"""
     200       
    206201        return self.cfgdict.get(key, None)
    207202
    208203    def __str__(self):
    209         """
    210         __str__(self) -> String
    211         """
     204        """__str__(self) -> String"""
     205       
    212206        return "<config object at %s>" % hex(id(self))
    213207
    214208    def getfilename(self):
    215         """
    216         getfilename(self) -> String filename
    217         """
     209        """getfilename(self) -> String filename"""
     210       
    218211        return self.configfile
    219212
    220213    def setdeleted(self):
    221         """
    222         setdeleted(self)
    223         """
     214        """setdeleted(self)"""
     215       
    224216        self.delconf = True
    225217
    226218    def save(self):
    227         """
    228         save(self)
    229         """
     219        """save(self)"""
     220       
    230221        try:
    231222            f = open(self.configfile, "w")
     
    239230
    240231    def close(self):
    241         """
    242         close(self)
    243         """
     232        """close(self)"""
     233       
    244234        if self.changed:
    245235            self.save()
     
    249239
    250240    def __del__(self):
    251         """
    252         __del__(self)
    253         """
     241        """__del__(self)"""
     242       
    254243        self.close()
     244       
    255245
    256246################################################################################
Note: See TracChangeset for help on using the changeset viewer.