some changes

This commit is contained in:
Anthony Scopatz 2016-06-13 03:02:24 -04:00
parent 357a60fbff
commit 38c07b1772
8 changed files with 14 additions and 12 deletions

View file

@ -293,7 +293,7 @@ def main(args=None):
if args is None: if args is None:
args = sys.argv args = sys.argv
for pkg in args[1:]: for pkg in args[1:]:
print('amalgamating ' + pkg) print('Amalgamating ' + pkg)
exclude = read_exclude(pkg) exclude = read_exclude(pkg)
print(' excluding {}'.format(pprint.pformat(exclude))) print(' excluding {}'.format(pprint.pformat(exclude)))
graph = make_graph(pkg, exclude=exclude) graph = make_graph(pkg, exclude=exclude)

View file

@ -35,7 +35,7 @@ except ImportError:
from xonsh import __version__ as XONSH_VERSION from xonsh import __version__ as XONSH_VERSION
TABLES = ['xonsh/lexer_table.py', 'xonsh/parser_table.py'] TABLES = ['xonsh/lexer_table.py', 'xonsh/parser_table.py', 'xonsh/__amalgam__.py']
def clean_tables(): def clean_tables():
@ -53,6 +53,8 @@ def build_tables():
from xonsh.parser import Parser from xonsh.parser import Parser
Parser(lexer_table='lexer_table', yacc_table='parser_table', Parser(lexer_table='lexer_table', yacc_table='parser_table',
outputdir='xonsh') outputdir='xonsh')
import amalgamate
amalgamate.main(['amalgamate', 'xonsh'])
sys.path.pop(0) sys.path.pop(0)

View file

@ -12,15 +12,15 @@ from xonsh.dirstack import cd, pushd, popd, dirs, _get_cwd
from xonsh.environ import locate_binary from xonsh.environ import locate_binary
from xonsh.foreign_shells import foreign_shell_data from xonsh.foreign_shells import foreign_shell_data
from xonsh.jobs import jobs, fg, bg, clean_jobs from xonsh.jobs import jobs, fg, bg, clean_jobs
from xonsh.history import main as history_alias from xonsh.history import history_main
from xonsh.platform import ON_ANACONDA, ON_DARWIN, ON_WINDOWS, scandir from xonsh.platform import ON_ANACONDA, ON_DARWIN, ON_WINDOWS, scandir
from xonsh.proc import foreground from xonsh.proc import foreground
from xonsh.replay import main as replay_main from xonsh.replay import replay_main
from xonsh.timings import timeit_alias from xonsh.timings import timeit_alias
from xonsh.tools import (XonshError, argvquote, escape_windows_cmd_string, from xonsh.tools import (XonshError, argvquote, escape_windows_cmd_string,
to_bool) to_bool)
from xonsh.vox import Vox from xonsh.vox import Vox
from xonsh.xontribs import main as xontribs_main from xonsh.xontribs import xontribs_main
from xonsh.xoreutils import _which from xonsh.xoreutils import _which
from xonsh.completers._aliases import completer_alias from xonsh.completers._aliases import completer_alias
@ -508,7 +508,7 @@ def make_default_aliases():
'source-bash': ['source-foreign', 'bash', '--sourcer=source'], 'source-bash': ['source-foreign', 'bash', '--sourcer=source'],
'source-cmd': source_cmd, 'source-cmd': source_cmd,
'source-foreign': source_foreign, 'source-foreign': source_foreign,
'history': history_alias, 'history': history_main,
'replay': replay_main, 'replay': replay_main,
'!!': bang_bang, '!!': bang_bang,
'!n': bang_n, '!n': bang_n,

View file

@ -39,7 +39,7 @@ class Execer(object):
self.filename = filename self.filename = filename
self.debug_level = debug_level self.debug_level = debug_level
self.unload = unload self.unload = unload
self.ctxtransformer = ast.CtxAwareTransformer(self.parser) self.ctxtransformer = CtxAwareTransformer(self.parser)
load_builtins(execer=self, config=config, login=login, ctx=xonsh_ctx) load_builtins(execer=self, config=config, login=login, ctx=xonsh_ctx)
def __del__(self): def __del__(self):

View file

@ -455,7 +455,7 @@ def _main(hist, args):
_MAIN_ACTIONS[ns.action](ns, hist) _MAIN_ACTIONS[ns.action](ns, hist)
def main(args=None, stdin=None): def history_main(args=None, stdin=None):
"""This is the history command entry point.""" """This is the history command entry point."""
_ = stdin _ = stdin
_main(builtins.__xonsh_history__, args) # pylint: disable=no-member _main(builtins.__xonsh_history__, args) # pylint: disable=no-member

View file

@ -113,7 +113,7 @@ def _main_action(ns, h=None):
history_info(ns, hist) history_info(ns, hist)
def main(args, stdin=None): def replay_main(args, stdin=None):
"""Acts as main function for replaying a xonsh history file.""" """Acts as main function for replaying a xonsh history file."""
parser = _create_parser() parser = _create_parser()
ns = parser.parse_args(args) ns = parser.parse_args(args)

View file

@ -507,7 +507,7 @@ def detect_encoding(readline):
return default, [first, second] return default, [first, second]
def open(filename): def _tokopen(filename):
"""Open a file in read only mode using the encoding detected by """Open a file in read only mode using the encoding detected by
detect_encoding(). detect_encoding().
""" """

View file

@ -129,7 +129,7 @@ _MAIN_ACTIONS = {
'list': _list, 'list': _list,
} }
def main(args=None, stdin=None): def xontribs_main(args=None, stdin=None):
"""Alias that loads xontribs""" """Alias that loads xontribs"""
if not args or (args[0] not in _MAIN_ACTIONS and if not args or (args[0] not in _MAIN_ACTIONS and
args[0] not in {'-h', '--help'}): args[0] not in {'-h', '--help'}):