<s> import re <EOL> from sarge import capture_stdout , run <EOL> from dokku_client . command_tools import global_opts_doc <EOL> class BaseCommand ( object ) : <EOL> check_config = True <EOL> sort_order = <NUM_LIT:10> <EOL> def __init__ ( self , name ) : <EOL> self . _name = name <EOL> self . args = { } <EOL> @ property <EOL> def doc ( self ) : <EOL> """<STR_LIT>""" <EOL> doc = self . __doc__ <EOL> doc = re . sub ( r'<STR_LIT>' , '<STR_LIT>' , doc , flags = re . MULTILINE ) <EOL> doc = re . sub ( r'<STR_LIT>' , "<STR_LIT>" % global_opts_doc ( ) , doc ) <EOL> return doc <EOL> @ property <EOL> def description ( self ) : <EOL> return self . __doc__ . strip ( ) . split ( "<STR_LIT:\n>" ) [ <NUM_LIT:0> ] <EOL> @ property <EOL> def name ( self ) : <EOL> return self . _name <EOL> def main ( self , global_args , command_args ) : <EOL> raise NotImplementedError ( '<STR_LIT>' ) <EOL> def run_remote ( self , cmd , input = None ) : <EOL> host = self . args [ '<STR_LIT>' ] <EOL> return capture_stdout ( '<STR_LIT>' % ( host , cmd ) , input = input ) <EOL> def restart_container ( self ) : <EOL> app = self . args [ '<STR_LIT>' ] <EOL> self . run_remote ( '<STR_LIT>' % app ) </s>
