Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from twisted.application import service, internet
- from twisted.spread import pb
- from twisted.internet import reactor
- import os
- class BkpHelp(pb.Root):
- def remote_get_files(self):
- tmp = []
- for fp, rp, fi in os.walk('/var/datos/sisprop/ARCHIVOS'):
- for arc in fi:
- fpath = '%s/%s' % (fp, arc)
- tmp.append((fpath, arc))
- return tmp
- class BkpHelpService(internet.TCPServer):
- """
- use to launch twisted like a daemon
- """
- def __init__(self):
- internet.TCPServer.__init__(self,8800,pb.PBServerFactory(BkpHelp()))
Advertisement
Add Comment
Please, Sign In to add comment