def get_editor(): user_editor = None c = SmashConfig() econfig = c.load_from_etc(fname_editor_config) if is_windowing_env: user_editor = econfig['window_env'] else: user_editor = econfig['console'] editor = user_editor return editor
def _load_prompt_config(self): c = SmashConfig() components = c.load_from_etc('prompt.json') if not components: components = DEFAULT_PROMPT out = [] for component in components: out.append(PromptComponent(**component)) components = out self.prompt_components = components
def main(): os.environ['SMASH'] = '1' hijack_ipython_module() # imports below must come after hijack from smashlib import embed from smashlib.config import SmashConfig, SmashUserConfig smash_prof = SmashConfig.ensure()['profile'] SmashUserConfig.ensure() embed(["--profile-dir={0}".format(smash_prof), ], # do not let smash inspect the caller context # and automatically update globals/locals user_ns=None )
# 2) default smash config: ~/.smash/profile_SmaSh/ipython_config.py # # Note that while the main configuration file at ~/.smash/profile_SmaSh # cannot be edited, you can make any overrides you would like to make there # in here instead. # _ = get_config() get_config = eval("get_config") # shut up the linter # always inherit the default ipython profile's configuration # load_subconfig('ipython_config.py', profile='default') from smashlib.config import SmashConfig config = SmashConfig(_) # every smash component gets it's own verbosity setting. # this mostly controls the printing of debugging info _.Smash.ignore_warnings = True _.Smash.verbose = False _.Smash.verbose_events = True _.LiquidPrompt.verbose = False _.ProjectManager.verbose = False _.ChangeDirHooks.verbose = False _.VirtualEnvSupport.verbose = True _.PyLinter.verbose = True _.PyLinter.ignore_pep8 = True # begin Change-Dir-hooks configuration: add any custom hooks here
_.PromptManager.justify = False # configure the project manager extension ########################################################################## projects = _.ProjectManager # this is safe even when the directories do not exist projects.search_dirs.append("~/code") projects.search_dirs.append("~/projects") projects.search_dirs.append("~/.virtualenvs") # load user's project manager configs from the ~/.smash/etc json # see docs at: http://mattvonrocketstein.github.io/smash/project_manager.html from smashlib.config import SmashConfig config = SmashConfig(_) config.append_from_etc(projects.search_dirs, "search_dirs.json") config.update_from_etc(projects.project_map, "projects.json") config.update_from_etc(projects.macro_map, "macros.json") config.update_from_etc(projects.alias_map, "aliases.json") config.append_from_etc(_.Smash.plugins, "plugins.json") config.update_from_etc(projects.env_map, "env.json") # configure the ipython app ########################################################################## app = _.InteractiveShellApp # NB: Here's an easy way to issue adhoc # commands, or modify the user namespace: #