<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> import os <EOL> import re <EOL> import sys <EOL> from . import metadata <EOL> from . common import getcwd <EOL> from . common import printed_fill <EOL> from . common import remove_ansi_escape <EOL> from . common import terminal_width <EOL> from . metadata import find_enclosing_workspace <EOL> from . resultspace import get_resultspace_environment <EOL> from . terminal_color import ColorMapper <EOL> color_mapper = ColorMapper ( ) <EOL> clr = color_mapper . clr <EOL> class Context ( object ) : <EOL> """<STR_LIT>""" <EOL> DEFAULT_LOG_SPACE = '<STR_LIT>' <EOL> DEFAULT_SOURCE_SPACE = '<STR_LIT:src>' <EOL> DEFAULT_BUILD_SPACE = '<STR_LIT>' <EOL> DEFAULT_DEVEL_SPACE = '<STR_LIT>' <EOL> DEFAULT_INSTALL_SPACE = '<STR_LIT>' <EOL> STORED_KEYS = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] <EOL> KEYS = STORED_KEYS + [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] <EOL> @ classmethod <EOL> def load ( <EOL> cls , <EOL> workspace_hint = None , <EOL> profile = None , <EOL> opts = None , <EOL> strict = False , <EOL> append = False , <EOL> remove = False , <EOL> load_env = True <EOL> ) : <EOL> """<STR_LIT>""" <EOL> opts_vars = vars ( opts ) if opts else { } <EOL> workspace_hint = workspace_hint or opts_vars . get ( '<STR_LIT>' , None ) or getcwd ( ) <EOL> workspace = find_enclosing_workspace ( workspace_hint ) <EOL> if not workspace : <EOL> if strict or not workspace_hint : <EOL> return None <EOL> else : <EOL> workspace = workspace_hint <EOL> opts_vars [ '<STR_LIT>' ] = workspace <EOL> profile = profile or opts_vars . get ( '<STR_LIT>' , None ) or metadata . get_active_profile ( workspace ) <EOL> opts_vars [ '<STR_LIT>' ] = profile <EOL> config_metadata = { } <EOL> context_args = { } <EOL> if workspace : <EOL> config_metadata = metadata . get_metadata ( workspace , profile , '<STR_LIT>' ) <EOL> context_args . update ( config_metadata ) <EOL> for ( k , v ) in opts_vars . items ( ) : <EOL> if k in Context . KEYS and v is not None : <EOL> if type ( context_args . get ( k , None ) ) is list and type ( v ) is list : <EOL> if append : <EOL> context_args [ k ] += v <EOL> elif remove : <EOL> context_args [ k ] = [ w for w in context_args [ k ] if w not in v ] <EOL> else : <EOL> context_args [ k ] = v <EOL> else : <EOL> context_args [ k ] = v <EOL> ctx = Context ( ** context_args ) <EOL> if load_env : <EOL> ctx . load_env ( ) <EOL> return ctx <EOL> @ classmethod <EOL> def save ( cls , context ) : <EOL> """<STR_LIT>""" <EOL> metadata . update_metadata ( <EOL> context . workspace , <EOL> context . profile , <EOL> '<STR_LIT>' , <EOL> context . get_stored_dict ( ) ) <EOL> def get_stored_dict ( self ) : <EOL> """<STR_LIT>""" <EOL> return dict ( [ ( k , getattr ( self , k ) ) for k in Context . STORED_KEYS ] ) <EOL> def __init__ ( <EOL> self , <EOL> workspace = None , <EOL> profile = None , <EOL> extend_path = None , <EOL> source_space = None , <EOL> log_space = None , <EOL> build_space = None , <EOL> devel_space = None , <EOL> install_space = None , <EOL> devel_layout = None , <EOL> install = False , <EOL> isolate_install = False , <EOL> cmake_args = None , <EOL> make_args = None , <EOL> jobs_args = None , <EOL> use_internal_make_jobserver = True , <EOL> use_env_cache = False , <EOL> catkin_make_args = None , <EOL> space_suffix = None , <EOL> whitelist = None , <EOL> blacklist = None , <EOL> ** kwargs <EOL> ) : <EOL> """<STR_LIT>""" <EOL> self . __locked = False <EOL> if len ( kwargs ) > <NUM_LIT:0> : <EOL> print ( '<STR_LIT>' . format ( kwargs ) , file = sys . stderr ) <EOL> self . workspace = workspace <EOL> self . extend_path = extend_path if extend_path else None <EOL> ss = '<STR_LIT>' if space_suffix is None else space_suffix <EOL> self . profile = profile <EOL> self . source_space = Context . DEFAULT_SOURCE_SPACE if source_space is None else source_space <EOL> self . log_space = Context . DEFAULT_LOG_SPACE + ss if ss or log_space is None else log_space <EOL> self . build_space = Context . DEFAULT_BUILD_SPACE + ss if ss or build_space is None else build_space <EOL> self . devel_space = Context . DEFAULT_DEVEL_SPACE + ss if ss or devel_space is None else devel_space <EOL> self . install_space = Context . DEFAULT_INSTALL_SPACE + ss if ss or install_space is None else install_space <EOL> self . destdir = os . environ [ '<STR_LIT>' ] if '<STR_LIT>' in os . environ else None <EOL> self . whitelist = whitelist or [ ] <EOL> self . blacklist = blacklist or [ ] <EOL> self . devel_layout = devel_layout if devel_layout else '<STR_LIT>' <EOL> self . install = install <EOL> self . isolate_install = isolate_install <EOL> self . cmake_args = cmake_args or [ ] <EOL> self . make_args = make_args or [ ] <EOL> self . jobs_args = jobs_args or [ ] <EOL> self . use_internal_make_jobserver = use_internal_make_jobserver <EOL> self . use_env_cache = use_env_cache <EOL> self . catkin_make_args = catkin_make_args or [ ] <EOL> self . packages = [ ] <EOL> self . warnings = [ ] <EOL> self . manual_cmake_prefix_path = None <EOL> self . cached_cmake_prefix_path = None <EOL> self . env_cmake_prefix_path = None <EOL> self . cmake_prefix_path = None <EOL> def load_env ( self ) : <EOL> self . manual_cmake_prefix_path = '<STR_LIT>' <EOL> for cmake_arg in self . cmake_args : <EOL> prefix_path_match = re . findall ( '<STR_LIT>' , cmake_arg ) <EOL> if len ( prefix_path_match ) > <NUM_LIT:0> : <EOL> self . manual_cmake_prefix_path = prefix_path_match [ <NUM_LIT:0> ] <EOL> if self . install : <EOL> sticky_env = get_resultspace_environment ( self . install_space_abs , quiet = True ) <EOL> else : <EOL> sticky_env = get_resultspace_environment ( self . devel_space_abs , quiet = True ) <EOL> self . cached_cmake_prefix_path = '<STR_LIT>' <EOL> if '<STR_LIT>' in sticky_env : <EOL> split_result_cmake_prefix_path = sticky_env . get ( '<STR_LIT>' , '<STR_LIT>' ) . split ( '<STR_LIT::>' ) <EOL> if len ( split_result_cmake_prefix_path ) > <NUM_LIT:1> : <EOL> self . cached_cmake_prefix_path = '<STR_LIT::>' . join ( split_result_cmake_prefix_path [ <NUM_LIT:1> : ] ) <EOL> self . env_cmake_prefix_path = '<STR_LIT>' <EOL> if self . extend_path : <EOL> extended_env = get_resultspace_environment ( self . extend_path , quiet = False ) <EOL> self . env_cmake_prefix_path = extended_env . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> if not self . env_cmake_prefix_path : <EOL> print ( clr ( "<STR_LIT>" <EOL> "<STR_LIT>" % self . extend_path ) ) <EOL> print ( extended_env ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> else : <EOL> if '<STR_LIT>' in os . environ : <EOL> split_result_cmake_prefix_path = os . environ [ '<STR_LIT>' ] . split ( '<STR_LIT::>' ) <EOL> if len ( split_result_cmake_prefix_path ) > <NUM_LIT:1> and ( <EOL> ( not self . install and split_result_cmake_prefix_path [ <NUM_LIT:0> ] == self . devel_space_abs ) or <EOL> ( self . install and split_result_cmake_prefix_path [ <NUM_LIT:0> ] == self . install_space_abs ) ) : <EOL> self . env_cmake_prefix_path = '<STR_LIT::>' . join ( split_result_cmake_prefix_path [ <NUM_LIT:1> : ] ) <EOL> else : <EOL> self . env_cmake_prefix_path = os . environ . get ( '<STR_LIT>' , '<STR_LIT>' ) . rstrip ( '<STR_LIT::>' ) <EOL> if ( self . devel_layout == '<STR_LIT>' and <EOL> ( self . extend_path is None and <EOL> not self . cached_cmake_prefix_path and <EOL> not self . env_cmake_prefix_path ) ) : <EOL> self . warnings += [ clr ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) ] <EOL> elif self . cached_cmake_prefix_path and self . extend_path : <EOL> ep_not_in_lcpp = any ( [ self . extend_path in p for p in self . cached_cmake_prefix_path . split ( '<STR_LIT::>' ) ] ) <EOL> if not ep_not_in_lcpp : <EOL> self . warnings += [ clr ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> % ( self . cached_cmake_prefix_path , self . env_cmake_prefix_path ) ) ] <EOL> elif self . env_cmake_prefix_path and self . cached_cmake_prefix_path and self . env_cmake_prefix_path != self . cached_cmake_prefix_path : <EOL> self . warnings += [ clr ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" % <EOL> ( self . cached_cmake_prefix_path , self . env_cmake_prefix_path ) ) ] <EOL> if self . manual_cmake_prefix_path : <EOL> self . cmake_prefix_path = self . manual_cmake_prefix_path <EOL> elif self . cached_cmake_prefix_path : <EOL> self . cmake_prefix_path = self . cached_cmake_prefix_path <EOL> else : <EOL> self . cmake_prefix_path = self . env_cmake_prefix_path <EOL> def summary ( self , notes = [ ] ) : <EOL> summary_warnings = self . warnings <EOL> if not self . initialized ( ) : <EOL> summary_warnings += [ clr ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) ] <EOL> if not self . source_space_exists ( ) : <EOL> summary_warnings += [ clr ( <EOL> "<STR_LIT>" ) ] <EOL> summary = [ <EOL> [ <EOL> clr ( "<STR_LIT>" ) , <EOL> clr ( "<STR_LIT>" ) , <EOL> clr ( "<STR_LIT>" ) , <EOL> ] , <EOL> [ <EOL> clr ( "<STR_LIT>" ) , <EOL> clr ( "<STR_LIT>" ) , <EOL> clr ( "<STR_LIT>" ) , <EOL> clr ( "<STR_LIT>" ) , <EOL> clr ( "<STR_LIT>" ) , <EOL> clr ( "<STR_LIT>" ) <EOL> ] , <EOL> [ <EOL> clr ( "<STR_LIT>" ) , <EOL> clr ( "<STR_LIT>" ) , <EOL> ] , <EOL> [ <EOL> clr ( "<STR_LIT>" ) , <EOL> clr ( "<STR_LIT>" ) , <EOL> clr ( "<STR_LIT>" ) , <EOL> clr ( "<STR_LIT>" ) , <EOL> clr ( "<STR_LIT>" ) , <EOL> ] , <EOL> [ <EOL> clr ( "<STR_LIT>" ) , <EOL> clr ( "<STR_LIT>" ) , <EOL> ] <EOL> ] <EOL> if self . extend_path : <EOL> extend_value = self . extend_path <EOL> extend_mode = clr ( '<STR_LIT>' ) <EOL> elif self . cached_cmake_prefix_path : <EOL> extend_value = self . cmake_prefix_path <EOL> extend_mode = clr ( '<STR_LIT>' ) <EOL> elif ( self . env_cmake_prefix_path and <EOL> self . env_cmake_prefix_path != self . devel_space_abs and <EOL> self . env_cmake_prefix_path != self . install_space_abs ) : <EOL> extend_value = self . cmake_prefix_path <EOL> extend_mode = clr ( '<STR_LIT>' ) <EOL> else : <EOL> extend_value = '<STR_LIT:None>' <EOL> extend_mode = clr ( '<STR_LIT:U+0020>' ) <EOL> def existence_str ( path , used = True ) : <EOL> if used : <EOL> return clr ( '<STR_LIT>' if os . path . exists ( path ) else '<STR_LIT>' ) <EOL> else : <EOL> return clr ( '<STR_LIT>' ) <EOL> install_layout = '<STR_LIT:None>' <EOL> if self . __install : <EOL> install_layout = '<STR_LIT>' if not self . __isolate_install else '<STR_LIT>' <EOL> subs = { <EOL> '<STR_LIT>' : self . profile , <EOL> '<STR_LIT>' : extend_mode , <EOL> '<STR_LIT>' : extend_value , <EOL> '<STR_LIT>' : install_layout , <EOL> '<STR_LIT>' : ( self . cmake_prefix_path or [ '<STR_LIT>' ] ) , <EOL> '<STR_LIT>' : '<STR_LIT:U+0020>' . join ( self . __cmake_args or [ '<STR_LIT:None>' ] ) , <EOL> '<STR_LIT>' : '<STR_LIT:U+0020>' . join ( self . __make_args + self . __jobs_args or [ '<STR_LIT:None>' ] ) , <EOL> '<STR_LIT>' : '<STR_LIT:U+002CU+0020>' . join ( self . __catkin_make_args or [ '<STR_LIT:None>' ] ) , <EOL> '<STR_LIT>' : existence_str ( self . source_space_abs ) , <EOL> '<STR_LIT>' : existence_str ( self . log_space_abs ) , <EOL> '<STR_LIT>' : existence_str ( self . build_space_abs ) , <EOL> '<STR_LIT>' : existence_str ( self . devel_space_abs ) , <EOL> '<STR_LIT>' : existence_str ( self . install_space_abs , used = self . __install ) , <EOL> '<STR_LIT>' : existence_str ( self . destdir , used = self . destdir ) , <EOL> '<STR_LIT>' : '<STR_LIT:U+0020>' . join ( self . __whitelist or [ '<STR_LIT:None>' ] ) , <EOL> '<STR_LIT>' : '<STR_LIT:U+0020>' . join ( self . __blacklist or [ '<STR_LIT:None>' ] ) , <EOL> } <EOL> subs . update ( ** self . __dict__ ) <EOL> width = terminal_width ( ) <EOL> max_length = <NUM_LIT:0> <EOL> groups = [ ] <EOL> for group in summary : <EOL> for index , line in enumerate ( group ) : <EOL> group [ index ] = line . format ( ** subs ) <EOL> max_length = min ( width , max ( max_length , len ( remove_ansi_escape ( group [ index ] ) ) ) ) <EOL> groups . append ( "<STR_LIT:\n>" . join ( group ) ) <EOL> divider = clr ( '<STR_LIT>' + ( '<STR_LIT:->' * max_length ) + '<STR_LIT>' ) <EOL> warning_divider = clr ( '<STR_LIT>' + ( '<STR_LIT:->' * max_length ) + '<STR_LIT>' ) <EOL> if len ( summary_warnings ) == <NUM_LIT:0> : <EOL> notes = [ clr ( "<STR_LIT>" ) ] + notes <EOL> warnings_joined = '<STR_LIT>' <EOL> else : <EOL> warnings_formatted = [ <EOL> printed_fill ( clr ( '<STR_LIT>' ) + sw . format ( ** subs ) , max_length ) <EOL> for sw in summary_warnings ] <EOL> warnings_joined = ( <EOL> "<STR_LIT>" + warning_divider + "<STR_LIT:\n>" + <EOL> ( "<STR_LIT:\n>" + warning_divider + "<STR_LIT:\n>" ) . join ( warnings_formatted ) + <EOL> "<STR_LIT:\n>" + warning_divider + "<STR_LIT:\n>" ) <EOL> return ( divider + "<STR_LIT:\n>" + <EOL> ( "<STR_LIT:\n>" + divider + "<STR_LIT:\n>" ) . join ( groups ) + "<STR_LIT:\n>" + divider + "<STR_LIT:\n>" + <EOL> ( ( ( "<STR_LIT>" ) . join ( notes ) + "<STR_LIT:\n>" + divider ) if notes else '<STR_LIT>' ) + <EOL> warnings_joined ) <EOL> @ property <EOL> def workspace ( self ) : <EOL> return self . __workspace <EOL> @ workspace . setter <EOL> def workspace ( self , value ) : <EOL> if self . __locked : <EOL> raise RuntimeError ( "<STR_LIT>" ) <EOL> if not os . path . exists ( value ) : <EOL> raise ValueError ( "<STR_LIT>" . format ( value ) ) <EOL> self . __workspace = os . path . abspath ( value ) <EOL> @ property <EOL> def extend_path ( self ) : <EOL> return self . __extend_path <EOL> @ extend_path . setter <EOL> def extend_path ( self , value ) : <EOL> if value is not None : <EOL> if not os . path . isabs ( value ) : <EOL> value = os . path . join ( self . workspace , value ) <EOL> value = os . path . normpath ( value ) <EOL> if not os . path . exists ( value ) : <EOL> raise ValueError ( "<STR_LIT>" . format ( value ) ) <EOL> self . __extend_path = value <EOL> @ property <EOL> def source_space_abs ( self ) : <EOL> return self . __source_space_abs <EOL> @ property <EOL> def source_space ( self ) : <EOL> return self . __source_space <EOL> @ source_space . setter <EOL> def source_space ( self , value ) : <EOL> if self . __locked : <EOL> raise RuntimeError ( "<STR_LIT>" ) <EOL> self . __source_space = value <EOL> self . __source_space_abs = os . path . join ( self . __workspace , value ) <EOL> def source_space_exists ( self ) : <EOL> "<STR_LIT>" <EOL> return os . path . exists ( self . source_space_abs ) and os . path . isdir ( self . source_space_abs ) <EOL> def initialized ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . workspace == find_enclosing_workspace ( self . workspace ) <EOL> @ property <EOL> def log_space_abs ( self ) : <EOL> return self . __log_space_abs <EOL> @ property <EOL> def log_space ( self ) : <EOL> return self . __log_space <EOL> @ log_space . setter <EOL> def log_space ( self , value ) : <EOL> if self . __locked : <EOL> raise RuntimeError ( "<STR_LIT>" ) <EOL> self . __log_space = value <EOL> self . __log_space_abs = os . path . join ( self . __workspace , value ) <EOL> @ property <EOL> def build_space_abs ( self ) : <EOL> return self . __build_space_abs <EOL> @ property <EOL> def build_space ( self ) : <EOL> return self . __build_space <EOL> @ build_space . setter <EOL> def build_space ( self , value ) : <EOL> if self . __locked : <EOL> raise RuntimeError ( "<STR_LIT>" ) <EOL> self . __build_space = value <EOL> self . __build_space_abs = os . path . join ( self . __workspace , value ) <EOL> @ property <EOL> def devel_space_abs ( self ) : <EOL> return self . __devel_space_abs <EOL> @ property <EOL> def devel_space ( self ) : <EOL> return self . __devel_space <EOL> @ devel_space . setter <EOL> def devel_space ( self , value ) : <EOL> if self . __locked : <EOL> raise RuntimeError ( "<STR_LIT>" ) <EOL> self . __devel_space = value <EOL> self . __devel_space_abs = os . path . join ( self . __workspace , value ) <EOL> @ property <EOL> def install_space_abs ( self ) : <EOL> return self . __install_space_abs <EOL> @ property <EOL> def install_space ( self ) : <EOL> return self . __install_space <EOL> @ install_space . setter <EOL> def install_space ( self , value ) : <EOL> if self . __locked : <EOL> raise RuntimeError ( "<STR_LIT>" ) <EOL> self . __install_space = value <EOL> self . __install_space_abs = os . path . join ( self . __workspace , value ) <EOL> @ property <EOL> def destdir ( self ) : <EOL> return self . __destdir <EOL> @ destdir . setter <EOL> def destdir ( self , value ) : <EOL> if self . __locked : <EOL> raise RuntimeError ( "<STR_LIT>" ) <EOL> self . __destdir = value <EOL> @ property <EOL> def devel_layout ( self ) : <EOL> return self . __devel_layout <EOL> @ devel_layout . setter <EOL> def devel_layout ( self , value ) : <EOL> if self . __locked : <EOL> raise RuntimeError ( "<STR_LIT>" ) <EOL> self . __devel_layout = value <EOL> @ property <EOL> def merge_devel ( self ) : <EOL> return self . devel_layout == '<STR_LIT>' <EOL> @ property <EOL> def link_devel ( self ) : <EOL> return self . devel_layout == '<STR_LIT>' <EOL> @ property <EOL> def isolate_devel ( self ) : <EOL> return self . devel_layout == '<STR_LIT>' <EOL> @ property <EOL> def install ( self ) : <EOL> return self . __install <EOL> @ install . setter <EOL> def install ( self , value ) : <EOL> if self . __locked : <EOL> raise RuntimeError ( "<STR_LIT>" ) <EOL> self . __install = value <EOL> @ property <EOL> def merge_install ( self ) : <EOL> return not self . __isolate_install <EOL> @ property <EOL> def isolate_install ( self ) : <EOL> return self . __isolate_install <EOL> @ isolate_install . setter <EOL> def isolate_install ( self , value ) : <EOL> if self . __locked : <EOL> raise RuntimeError ( "<STR_LIT>" ) <EOL> self . __isolate_install = value <EOL> @ property <EOL> def cmake_args ( self ) : <EOL> return self . __cmake_args <EOL> @ cmake_args . setter <EOL> def cmake_args ( self , value ) : <EOL> if self . __locked : <EOL> raise RuntimeError ( "<STR_LIT>" ) <EOL> self . __cmake_args = value <EOL> @ property <EOL> def make_args ( self ) : <EOL> return self . __make_args <EOL> @ make_args . setter <EOL> def make_args ( self , value ) : <EOL> if self . __locked : <EOL> raise RuntimeError ( "<STR_LIT>" ) <EOL> self . __make_args = value <EOL> @ property <EOL> def jobs_args ( self ) : <EOL> return self . __jobs_args <EOL> @ jobs_args . setter <EOL> def jobs_args ( self , value ) : <EOL> if self . __locked : <EOL> raise RuntimeError ( "<STR_LIT>" ) <EOL> self . __jobs_args = value <EOL> @ property <EOL> def use_internal_make_jobserver ( self ) : <EOL> return self . __use_internal_make_jobserver <EOL> @ use_internal_make_jobserver . setter <EOL> def use_internal_make_jobserver ( self , value ) : <EOL> if self . __locked : <EOL> raise RuntimeError ( "<STR_LIT>" ) <EOL> self . __use_internal_make_jobserver = value <EOL> @ property <EOL> def use_env_cache ( self ) : <EOL> return self . __use_env_cache <EOL> @ use_env_cache . setter <EOL> def use_env_cache ( self , value ) : <EOL> if self . __locked : <EOL> raise RuntimeError ( "<STR_LIT>" ) <EOL> self . __use_env_cache = value <EOL> @ property <EOL> def catkin_make_args ( self ) : <EOL> return self . __catkin_make_args <EOL> @ catkin_make_args . setter <EOL> def catkin_make_args ( self , value ) : <EOL> if self . __locked : <EOL> raise RuntimeError ( "<STR_LIT>" ) <EOL> self . __catkin_make_args = value <EOL> @ property <EOL> def packages ( self ) : <EOL> return self . __packages <EOL> @ packages . setter <EOL> def packages ( self , value ) : <EOL> if self . __locked : <EOL> raise RuntimeError ( "<STR_LIT>" ) <EOL> self . __packages = value <EOL> @ property <EOL> def whitelist ( self ) : <EOL> return self . __whitelist <EOL> @ whitelist . setter <EOL> def whitelist ( self , value ) : <EOL> self . __whitelist = value <EOL> @ property <EOL> def blacklist ( self ) : <EOL> return self . __blacklist <EOL> @ blacklist . setter <EOL> def blacklist ( self , value ) : <EOL> self . __blacklist = value <EOL> @ property <EOL> def private_devel_path ( self ) : <EOL> """<STR_LIT>""" <EOL> return os . path . join ( self . devel_space_abs , '<STR_LIT>' ) <EOL> def package_private_devel_path ( self , package ) : <EOL> """<STR_LIT>""" <EOL> return os . path . join ( self . private_devel_path , package . name ) <EOL> def package_build_space ( self , package ) : <EOL> """<STR_LIT>""" <EOL> return os . path . join ( self . build_space_abs , package . name ) <EOL> def package_devel_space ( self , package ) : <EOL> """<STR_LIT>""" <EOL> if self . merge_devel : <EOL> return self . devel_space_abs <EOL> elif self . isolate_devel : <EOL> return os . path . join ( self . devel_space_abs , package . name ) <EOL> elif self . link_devel : <EOL> return os . path . join ( self . private_devel_path , package . name ) <EOL> else : <EOL> raise ValueError ( '<STR_LIT>' . format ( self . devel_layout ) ) <EOL> def package_install_space ( self , package ) : <EOL> """<STR_LIT>""" <EOL> if self . merge_install : <EOL> return self . install_space_abs <EOL> elif self . isolate_install : <EOL> return os . path . join ( self . install_space_abs , package . name ) <EOL> else : <EOL> raise ValueError ( '<STR_LIT>' . format ( self . devel_layout ) ) <EOL> def package_dest_path ( self , package ) : <EOL> """<STR_LIT>""" <EOL> if self . destdir is None : <EOL> return self . package_final_path ( package ) <EOL> else : <EOL> return os . path . join ( <EOL> self . destdir , <EOL> self . package_install_space ( package ) . lstrip ( os . sep ) ) <EOL> def package_final_path ( self , package ) : <EOL> """<STR_LIT>""" <EOL> if self . install : <EOL> return self . package_install_space ( package ) <EOL> else : <EOL> if self . link_devel : <EOL> return self . devel_space_abs <EOL> else : <EOL> return self . package_devel_space ( package ) <EOL> def metadata_path ( self ) : <EOL> """<STR_LIT>""" <EOL> profile_path , _ = metadata . get_paths ( self . workspace , self . profile ) <EOL> return profile_path <EOL> def package_metadata_path ( self , package = None ) : <EOL> """<STR_LIT>""" <EOL> profile_path , _ = metadata . get_paths ( self . workspace , self . profile ) <EOL> if package is None : <EOL> return os . path . join ( profile_path , '<STR_LIT>' ) <EOL> return os . path . join ( profile_path , '<STR_LIT>' , package . name ) </s>
