<s> import sublime , sublime_plugin <EOL> import desktop <EOL> import os <EOL> class TitaAutoClean ( sublime_plugin . EventListener ) : <EOL> def on_post_save ( self , view ) : <EOL> current_file = view . file_name ( ) <EOL> if '<STR_LIT>' in current_file : <EOL> view . window ( ) . run_command ( '<STR_LIT>' ) <EOL> class BaseCommand ( sublime_plugin . WindowCommand ) : <EOL> def root ( self ) : <EOL> return self . window . folders ( ) [ <NUM_LIT:0> ] <EOL> def settings ( self ) : <EOL> return sublime . load_settings ( '<STR_LIT>' ) <EOL> def exec_command ( self , cmd ) : <EOL> command = { '<STR_LIT>' : cmd , '<STR_LIT>' : True , '<STR_LIT>' : self . root ( ) } <EOL> exec_args = self . settings ( ) . get ( '<STR_LIT>' ) <EOL> exec_args . update ( command ) <EOL> self . window . run_command ( "<STR_LIT>" , exec_args ) <EOL> def show_quick_panel ( self , options , done ) : <EOL> sublime . set_timeout ( lambda : self . window . show_quick_panel ( options , done ) , <NUM_LIT:10> ) <EOL> class Titaclean ( BaseCommand ) : <EOL> def run ( self , * args , ** kwargs ) : <EOL> sublime . status_message ( '<STR_LIT>' ) <EOL> self . exec_command ( u"<STR_LIT>" ) <EOL> class Titagenerate ( BaseCommand ) : <EOL> def on_done ( self , text ) : <EOL> sublime . status_message ( '<STR_LIT>' + text ) <EOL> self . exec_command ( u"<STR_LIT>" + text ) <EOL> def run ( self , * args , ** kwargs ) : <EOL> self . window . show_input_panel ( "<STR_LIT>" , "<STR_LIT>" , self . on_done , None , None ) <EOL> class Titalint ( BaseCommand ) : <EOL> osNames = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] <EOL> def on_done ( self , selectedIndex ) : <EOL> if selectedIndex < <NUM_LIT:0> : <EOL> return <EOL> osName = self . osNames [ selectedIndex ] <EOL> sublime . status_message ( '<STR_LIT>' ) <EOL> removecolors = "<STR_LIT>" <EOL> cmd = u"<STR_LIT>" % ( osName , removecolors ) <EOL> self . exec_command ( cmd ) <EOL> def run ( self , * args , ** kwargs ) : <EOL> print "<STR_LIT>" <EOL> self . show_quick_panel ( self . osNames , self . on_done ) <EOL> class TitaCommand ( BaseCommand ) : <EOL> def log_level ( self ) : <EOL> return self . settings ( ) . get ( '<STR_LIT>' ) . get ( '<STR_LIT>' ) <EOL> def android_sdk_path ( self ) : <EOL> return self . settings ( ) . get ( '<STR_LIT>' ) <EOL> def compile_alloy ( self , device ) : <EOL> self . exec_command ( u"<STR_LIT>" + device ) <EOL> def build ( self , device , target ) : <EOL> loglevel = self . log_level ( ) <EOL> if ( '<STR_LIT>' == device or '<STR_LIT>' == device ) : <EOL> cmd = u"<STR_LIT>" % ( device , target , loglevel ) <EOL> if ( '<STR_LIT>' == device ) : <EOL> androidsdkpath = self . android_sdk_path ( ) <EOL> cmd = u"<STR_LIT>" % ( device , target , androidsdkpath , loglevel ) <EOL> else : <EOL> cmd = u"<STR_LIT>" % ( device , loglevel ) <EOL> self . exec_command ( cmd ) <EOL> def run ( self , device = '<STR_LIT>' , target = '<STR_LIT>' , * args , ** kwargs ) : <EOL> self . compile_alloy ( device ) <EOL> self . build ( device , target ) <EOL> if ( '<STR_LIT>' == device ) : <EOL> desktop . open ( '<STR_LIT>' ) </s>
