diff -ur v23/ftp_ut.py v24/ftp_ut.py --- v23/ftp_ut.py 2020-04-29 18:41:38.000000000 +0900 +++ v24/ftp_ut.py 2020-05-02 19:50:48.000000000 +0900 @@ -21,7 +21,8 @@ def write(s): if debug: - dbg.out( '|>'+s ) + t = s.replace( passwd, '----' ) + dbg.out( '|>'+t ) s += '\n' proc.write(s) return s @@ -32,7 +33,9 @@ r = r.replace( '\r', '' ) if r and debug: r_ = r.replace('\n', '\\n\n') - dbg.out( to_str( r_.strip().split('\n'), pre='<|' ) ) + s = to_str( r_.strip().split('\n'), pre='<|' ) + t = s.replace( passwd, '----' ) + dbg.out( t ) if r is None: dbg.out( 'timeout' ) r = '' diff -ur v23/site_ut.py v24/site_ut.py --- v23/site_ut.py 2020-04-29 19:31:09.000000000 +0900 +++ v24/site_ut.py 2020-05-02 19:08:50.000000000 +0900 @@ -96,20 +96,22 @@ with open( path + '/' + scr, 'w' ) as f: f.write( s ) -def put(url, path, st, scr='dl.sh'): +def put(url, path, st, scr='dl.sh', verb=False): lmt_size = st.lmt_size if os.path.isdir( path ): lst = cmd_lst( 'find {} -type f -o -type l'.format( path ) ) for path_ in lst: - put( url, path_, st, scr ) + put( url, path_, st, scr, verb ) return if not lmt_size or os.path.getsize( path ) <= to_num( lmt_size ): opt = '-SITE "{} {} {}"'.format( st.host, st.user, st.passwd ) if st.path: opt += ' -C {}'.format( st.path ) + if verb: + opt = '-debug ' + opt cmd = cmd_ut.cmd_py( 'ftp_ut' ) + ' ' + opt + ' ' + path - call( cmd ) + cmd_ut.call_show( cmd ) # for -debug showing return (dir_, name) = os.path.split( path ) @@ -175,8 +177,8 @@ cmd = arg.get_name_args( cmds ) - def put_(path): - put( st.url, path, st ) + def put_(path, verb): + put( st.url, path, st, verb=verb ) def get_(path): dbg.out('url={} path={} curr={}'.format( st.url, path, os.getcwd() ) ) @@ -198,13 +200,13 @@ bak = os.getcwd() - C = cmd.opts.get( 'C' ) + C = cmd.opts.pop( 'C' ) if C: os.chdir( C ) if hasattr( fs, cmd.name ): func = getattr( fs, cmd.name ) - func( *cmd.args ) + func( *cmd.args, **cmd.opts ) if C: os.chdir( bak ) @@ -215,7 +217,7 @@ cmd_new = arg.cmd_new s = '"-C dir" is load yaml and ( cd dir ; ... )' cmds = [ - cmd_new( 'put', [ 'path' ], opts={ 'C': '' }, comment=s ), + cmd_new( 'put', [ 'path' ], opts={ 'C': '', 'verb': False }, comment=s ), cmd_new( 'get', [ 'path' ], opts={ 'C': '' }, comment=s ), cmd_new( 'exists', [ 'path' ], opts={ 'C': '' }, comment=s ), cmd_new( 'cat', [ 'path' ], opts={ 'C': '' }, comment=s ),