コード例 #1
0
 def _init_environ(self, ctx, config, rc, scriptcache, cacheall):
     self.ctx = {} if ctx is None else ctx
     debug = to_bool_or_int(os.getenv('XONSH_DEBUG', '0'))
     self.execer = Execer(config=config,
                          login=self.login,
                          xonsh_ctx=self.ctx,
                          debug_level=debug)
     self.execer.scriptcache = scriptcache
     self.execer.cacheall = cacheall
     if self.stype != 'none' or self.login:
         # load xontribs from config file
         names = builtins.__xonsh_config__.get('xontribs', ())
         for name in names:
             update_context(name, ctx=self.ctx)
         if getattr(update_context, 'bad_imports', None):
             prompt_xontrib_install(update_context.bad_imports)
             del update_context.bad_imports
         # load run control files
         env = builtins.__xonsh_env__
         rc = env.get('XONSHRC') if rc is None else rc
         self.ctx.update(
             xonshrc_context(rcfiles=rc,
                             execer=self.execer,
                             initial=self.ctx))
     self.ctx['__name__'] = '__main__'
コード例 #2
0
ファイル: shell.py プロジェクト: mwiebe/xonsh
 def _init_environ(self, ctx, config, rc, scriptcache, cacheall):
     self.ctx = {} if ctx is None else ctx
     self.execer = Execer(config=config, login=self.login, xonsh_ctx=self.ctx)
     self.execer.scriptcache = scriptcache
     self.execer.cacheall = cacheall
     if ctx is None and (self.stype != 'none' or self.login):
         # load xontribs from config file
         names = builtins.__xonsh_config__.get('xontribs', ())
         for name in names:
             xontribs.update_context(name, ctx=self.ctx)
         # load run control files
         env = builtins.__xonsh_env__
         rc = env.get('XONSHRC') if rc is None else rc
         self.ctx.update(xonshrc_context(rcfiles=rc, execer=self.execer))
     self.ctx['__name__'] = '__main__'
コード例 #3
0
ファイル: shell.py プロジェクト: wjwwood/xonsh
 def _init_environ(self, ctx, config, rc, scriptcache, cacheall):
     self.ctx = {} if ctx is None else ctx
     self.execer = Execer(config=config, login=self.login, xonsh_ctx=self.ctx)
     self.execer.scriptcache = scriptcache
     self.execer.cacheall = cacheall
     if self.stype != 'none' or self.login:
         # load xontribs from config file
         names = builtins.__xonsh_config__.get('xontribs', ())
         for name in names:
             xontribs.update_context(name, ctx=self.ctx)
         # load run control files
         env = builtins.__xonsh_env__
         rc = env.get('XONSHRC') if rc is None else rc
         self.ctx.update(xonshrc_context(rcfiles=rc, execer=self.execer, initial=self.ctx))
     self.ctx['__name__'] = '__main__'
コード例 #4
0
ファイル: shell.py プロジェクト: CJ-Wright/xonsh
 def _init_environ(self, ctx, config, rc):
     self.execer = Execer(config=config, login=self.login)
     if ctx is None:
         builtins.__xonsh_ctx__ = self.ctx = context = {}
         if self.login or self.stype != 'none':
             # load xontrib files listed in the config file
             names = builtins.__xonsh_config__.get('xontribs', ())
             for name in names:
                 xontribs.update_context(name, ctx=context)
             # load run contol files
             env = builtins.__xonsh_env__
             rc = env.get('XONSHRC') if rc is None else rc
             xonshrc_context(rcfiles=rc, execer=self.execer, ctx=context)
     else:
         builtins.__xonsh_ctx__ = self.ctx = ctx
     self.ctx['__name__'] = '__main__'
コード例 #5
0
ファイル: shell.py プロジェクト: AndreaCrotti/xonsh
 def _init_environ(self, ctx, config, rc, scriptcache, cacheall):
     self.ctx = {} if ctx is None else ctx
     debug = to_bool_or_int(os.getenv('XONSH_DEBUG', '0'))
     self.execer = Execer(config=config, login=self.login, xonsh_ctx=self.ctx,
                          debug_level=debug)
     self.execer.scriptcache = scriptcache
     self.execer.cacheall = cacheall
     if self.stype != 'none' or self.login:
         # load xontribs from config file
         names = builtins.__xonsh_config__.get('xontribs', ())
         for name in names:
             update_context(name, ctx=self.ctx)
         # load run control files
         env = builtins.__xonsh_env__
         rc = env.get('XONSHRC') if rc is None else rc
         self.ctx.update(xonshrc_context(rcfiles=rc, execer=self.execer, initial=self.ctx))
     self.ctx['__name__'] = '__main__'