<s> import utils <EOL> import logger <EOL> import os <EOL> import sh <EOL> lgr = logger . init ( ) <EOL> class Handler ( utils . Handler ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , name , input_type , output_type , source ) : <EOL> self . name = name <EOL> output_type = '<STR_LIT>' if output_type . startswith ( '<STR_LIT>' ) else output_type <EOL> input_type = input_type <EOL> self . source = source <EOL> self . command = sh . fpm . bake ( n = name , s = input_type , t = output_type ) <EOL> def _build_cmd_string ( self , ** fpm_params ) : <EOL> """<STR_LIT>""" <EOL> if fpm_params . get ( '<STR_LIT:version>' ) : <EOL> self . command = self . command . bake ( v = fpm_params [ '<STR_LIT:version>' ] ) <EOL> if fpm_params . get ( '<STR_LIT>' ) : <EOL> self . command = self . command . bake ( C = fpm_params [ '<STR_LIT>' ] ) <EOL> if fpm_params . get ( '<STR_LIT>' ) : <EOL> self . command = self . command . bake ( <EOL> '<STR_LIT>' , os . path . abspath ( <EOL> fpm_params [ '<STR_LIT>' ] ) ) <EOL> if fpm_params . get ( '<STR_LIT>' ) : <EOL> self . command = self . command . bake ( <EOL> '<STR_LIT>' , os . path . abspath ( <EOL> fpm_params [ '<STR_LIT>' ] ) ) <EOL> if fpm_params . get ( '<STR_LIT>' ) : <EOL> for depend in fpm_params [ '<STR_LIT>' ] : <EOL> self . command = self . command . bake ( d = depend ) <EOL> if fpm_params . get ( '<STR_LIT>' ) : <EOL> self . command = self . command . bake ( '<STR_LIT>' ) <EOL> self . command = self . command . bake ( self . source ) <EOL> lgr . debug ( '<STR_LIT>' . format ( self . command ) ) <EOL> return self . command <EOL> def execute ( self , ** fpm_params ) : <EOL> """<STR_LIT>""" <EOL> self . _build_cmd_string ( ** fpm_params ) <EOL> return self . command ( ) </s>
