<s> import module <EOL> import config as CFG <EOL> import os <EOL> import zlib <EOL> MODNAME = '<STR_LIT>' <EOL> USAGE = """<STR_LIT>""" . format ( CFG . ARCHIVE_DIR ) <EOL> @ module . server_handler ( MODNAME ) <EOL> def server ( server , argv ) : <EOL> if len ( argv ) < <NUM_LIT:2> or argv [ <NUM_LIT:1> ] in ( '<STR_LIT>' , '<STR_LIT>' ) : <EOL> print USAGE <EOL> return <EOL> for file in argv [ <NUM_LIT:1> : ] : <EOL> resp = server . conn . exchange ( '<STR_LIT>' + file ) <EOL> if '<STR_LIT>' in resp : <EOL> server . info ( '<STR_LIT>' . format ( resp , file ) ) <EOL> continue <EOL> resp = zlib . decompress ( resp ) <EOL> write_file = file . split ( '<STR_LIT:/>' ) [ - <NUM_LIT:1> ] . strip ( '<STR_LIT:.>' ) <EOL> server . write ( resp , argv [ <NUM_LIT:0> ] , write_file ) <EOL> @ module . client_handler ( MODNAME ) <EOL> def client ( client , inp ) : <EOL> with open ( os . path . expanduser ( inp [ <NUM_LIT:6> : ] ) ) as f : <EOL> client . s . send ( zlib . compress ( f . read ( ) ) ) </s>
