<s> import os <EOL> import sys <EOL> sys . path . append ( os . path . join ( os . path . dirname ( os . path . dirname ( <EOL> os . path . abspath ( __file__ ) ) ) , '<STR_LIT>' ) ) <EOL> from vistrails . db . services import io <EOL> from db_utils import parse_db_cmd_line <EOL> def delete_from_db ( config , obj_type , obj_id ) : <EOL> db_connection = io . open_db_connection ( config ) <EOL> io . delete_entity_from_db ( db_connection , obj_type , obj_id ) <EOL> io . close_db_connection ( db_connection ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> more_options = { '<STR_LIT>' : ( '<STR_LIT>' , False , '<STR_LIT>' ) , <EOL> '<STR_LIT>' : ( '<STR_LIT>' , True , '<STR_LIT>' ) , <EOL> } <EOL> config , options = parse_db_cmd_line ( sys . argv , more_options ) <EOL> obj_type = '<STR_LIT>' <EOL> if options [ '<STR_LIT:t>' ] : <EOL> obj_type = options [ '<STR_LIT:t>' ] <EOL> obj_id = int ( options [ '<STR_LIT:i>' ] ) <EOL> delete_from_db ( config , obj_type , obj_id ) </s>
