Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> from multiprocessing.managers import BaseManager
- >>>
- >>> class DataManager(BaseManager): pass
- ...
- >>> DataManager.register('get_data')
- >>> m = DataManager(address=('127.0.0.1', 7349), authkey='authKey')
- >>> m.connect()
- >>> q = m.get_data()
- >>>
- >>> dir(q)
- ['_Client', '__builtins__', '__class__', '__deepcopy__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_address_to_local', '_after_fork', '_authkey', '_callmethod', '_close', '_connect', '_decref', '_exposed_', '_getvalue', '_id', '_idset', '_incref', '_isauto', '_manager', '_mutex', '_serializer', '_tls', '_token', 'close', 'create', 'delete', 'exists', 'finish', 'get', 'internalLock', 'isDir', 'isFile', 'open', 'remove', 'set', 'tree']
- >>> q.create('/testing')
- True
- >>> q.set('/testing/dir1/dir2/file1', Value='FFFFFFF')
- True
- >>> q.get('/testing/dir1/dir2/file1')
- "'FFFFFFF'"
- >>> q.tree()
- [('/', []), (u'/testing', []), (u'/testing/dir1', []), (u'/testing/dir1/dir2', [u'file1'])]
- >>> q.exists('/testing/dir1/dir2/file1')
- True
- >>> q.exists('/testing/dir1/dir2/file2')
- False
- >>> q.isDir('/testing')
- True
- >>> q.isDir('/testing/dir1/dir2/file1')
- False
- >>> q.delete('/testing/dir1')
- True
- >>> q.tree()
- [('/', []), (u'/testing', [])]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement