<s> from kippo . core . honeypot import HoneyPotCommand <EOL> from kippo . core . fs import * <EOL> from kippo . core . config import config <EOL> from kippo . core import utils <EOL> import stat , time , anydbm <EOL> commands = { } <EOL> class command_last ( HoneyPotCommand ) : <EOL> def call ( self ) : <EOL> fn = '<STR_LIT>' % ( config ( ) . get ( '<STR_LIT>' , '<STR_LIT>' ) , ) <EOL> if not os . path . exists ( fn ) : <EOL> return <EOL> l = list ( self . args ) <EOL> numlines = <NUM_LIT> <EOL> while len ( l ) : <EOL> arg = l . pop ( <NUM_LIT:0> ) <EOL> if not arg . startswith ( '<STR_LIT:->' ) : <EOL> continue <EOL> elif arg [ <NUM_LIT:1> : ] . isdigit ( ) : <EOL> numlines = int ( arg [ <NUM_LIT:1> : ] ) <EOL> elif arg == '<STR_LIT>' and len ( l ) and l [ <NUM_LIT:0> ] . isdigit ( ) : <EOL> numlines = int ( l . pop ( <NUM_LIT:0> ) ) <EOL> data = utils . tail ( file ( fn ) , numlines ) <EOL> self . writeln ( '<STR_LIT>' . join ( data ) ) <EOL> commands [ '<STR_LIT>' ] = command_last </s>
