<s> from __future__ import absolute_import , print_function <EOL> import datetime <EOL> import os <EOL> from . . import cli , exceptions <EOL> from . . master import CURRENT as MASTER <EOL> parser = cli . parser ( <EOL> description = "<STR_LIT>" <EOL> ) <EOL> parser . task_argument ( ) <EOL> parser . path_argument ( ) <EOL> parser . enable_print_header ( ) <EOL> def format_line ( obj , base ) : <EOL> human_time = datetime . datetime . fromtimestamp ( obj [ "<STR_LIT>" ] ) . strftime ( <EOL> "<STR_LIT>" ) <EOL> fmt = "<STR_LIT>" <EOL> fname = os . path . relpath ( obj [ "<STR_LIT:path>" ] , base ) <EOL> return fmt . format ( human_time = human_time , fname = fname , ** obj ) <EOL> @ cli . init ( parser ) <EOL> def main ( args ) : <EOL> tlist = MASTER . tasks ( args . task ) <EOL> for task in tlist : <EOL> if len ( tlist ) > <NUM_LIT:1> and not args . q : <EOL> cli . header ( task ) <EOL> p = args . path <EOL> if p . endswith ( "<STR_LIT:/>" ) : <EOL> p = p [ : - <NUM_LIT:1> ] <EOL> try : <EOL> for fobj in task . file_list ( p ) : <EOL> print ( format_line ( <EOL> fobj , os . path . join ( task . directory , args . path ) ) ) <EOL> except exceptions . SlaveDoesNotExist : <EOL> continue </s>
