<s> """<STR_LIT>""" <EOL> __all__ = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] <EOL> import sys , os <EOL> from pycopia . remote import pyro <EOL> if sys . platform . startswith ( "<STR_LIT>" ) : <EOL> from pycopia . remote . PosixClient import * <EOL> elif sys . platform == "<STR_LIT>" : <EOL> from pycopia . remote . PosixClient import * <EOL> elif sys . platform == "<STR_LIT:win32>" : <EOL> from pycopia . remote . WindowsClient import * <EOL> del sys <EOL> class ProxyError ( pyro . PyroError ) : <EOL> pass <EOL> def get_remote ( hostname , servicename = None ) : <EOL> return pyro . get_remote ( hostname , servicename ) <EOL> def remote_copy ( agent , remfile , dst ) : <EOL> """<STR_LIT>""" <EOL> h = agent . fopen ( remfile , "<STR_LIT:rb>" ) <EOL> if os . path . isdir ( dst ) : <EOL> dst = os . path . join ( dst , os . path . basename ( remfile ) ) <EOL> dest = open ( dst , "<STR_LIT:wb>" ) <EOL> while <NUM_LIT:1> : <EOL> data = agent . fread ( h , <NUM_LIT> ) <EOL> if not data : <EOL> break <EOL> dest . write ( data ) <EOL> dest . close ( ) <EOL> agent . fclose ( h ) <EOL> def get_controller ( equipment , logfile = None , servicename = "<STR_LIT>" ) : <EOL> client = get_remote ( equipment [ "<STR_LIT>" ] , servicename ) <EOL> if logfile : <EOL> logfile . write ( "<STR_LIT>" % ( client , ) ) <EOL> return client <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> rem = get_remote ( "<STR_LIT:localhost>" , "<STR_LIT>" ) </s>
