<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> import os <EOL> from anvil . context import RuleContext <EOL> from anvil . rule import Rule , build_rule <EOL> from anvil . task import Task , NodeExecutableTask <EOL> @ build_rule ( '<STR_LIT>' ) <EOL> class LessCssLibraryRule ( Rule ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , name , include_paths = None , <EOL> compiler_flags = None , out = None , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> super ( LessCssLibraryRule , self ) . __init__ ( name , * args , ** kwargs ) <EOL> self . include_paths = [ ] <EOL> if include_paths : <EOL> self . include_paths . extend ( include_paths ) <EOL> self . _append_dependent_paths ( self . include_paths ) <EOL> self . compiler_flags = [ ] <EOL> if compiler_flags : <EOL> self . compiler_flags . extend ( compiler_flags ) <EOL> self . out = out <EOL> class _Context ( RuleContext ) : <EOL> def begin ( self ) : <EOL> super ( LessCssLibraryRule . _Context , self ) . begin ( ) <EOL> args = [ <EOL> ] <EOL> args . extend ( self . rule . compiler_flags ) <EOL> if len ( self . rule . include_paths ) : <EOL> args . append ( '<STR_LIT>' % ( <EOL> '<STR_LIT::>' . join ( self . rule . include_paths ) ) ) <EOL> output_path = self . _get_out_path ( name = self . rule . out , suffix = '<STR_LIT>' ) <EOL> self . _ensure_output_exists ( os . path . dirname ( output_path ) ) <EOL> self . _append_output_paths ( [ output_path ] ) <EOL> args . append ( self . src_paths [ <NUM_LIT:0> ] ) <EOL> args . append ( output_path ) <EOL> if self . _check_if_cached ( ) : <EOL> self . _succeed ( ) <EOL> return <EOL> d = self . _run_task_async ( NodeExecutableTask ( <EOL> self . build_env , '<STR_LIT>' , args ) ) <EOL> self . _chain ( d ) </s>
