Merge branch 'emfixes' into m

This commit is contained in:
Anthony Scopatz 2016-08-28 10:33:56 -04:00
commit bff2ccb6d1
3 changed files with 13 additions and 12 deletions

View file

@ -111,5 +111,7 @@ def test_transmogrify_by_string(events):
assert inspect.getdoc(events.on_test) == docstring
def test_typos(xonsh_builtins):
for ev in vars(xonsh_builtins.events).values():
assert inspect.getdoc(ev)
for name, ev in vars(xonsh_builtins.events).items():
if 'pytest' in name:
continue
assert inspect.getdoc(ev)

View file

@ -43,8 +43,6 @@ else:
_sys.modules['xonsh.contexts'] = __amalgam__
diff_history = __amalgam__
_sys.modules['xonsh.diff_history'] = __amalgam__
dirstack = __amalgam__
_sys.modules['xonsh.dirstack'] = __amalgam__
events = __amalgam__
_sys.modules['xonsh.events'] = __amalgam__
foreign_shells = __amalgam__
@ -57,14 +55,16 @@ else:
_sys.modules['xonsh.proc'] = __amalgam__
xontribs = __amalgam__
_sys.modules['xonsh.xontribs'] = __amalgam__
commands_cache = __amalgam__
_sys.modules['xonsh.commands_cache'] = __amalgam__
environ = __amalgam__
_sys.modules['xonsh.environ'] = __amalgam__
dirstack = __amalgam__
_sys.modules['xonsh.dirstack'] = __amalgam__
history = __amalgam__
_sys.modules['xonsh.history'] = __amalgam__
inspectors = __amalgam__
_sys.modules['xonsh.inspectors'] = __amalgam__
commands_cache = __amalgam__
_sys.modules['xonsh.commands_cache'] = __amalgam__
environ = __amalgam__
_sys.modules['xonsh.environ'] = __amalgam__
base_shell = __amalgam__
_sys.modules['xonsh.base_shell'] = __amalgam__
replay = __amalgam__

View file

@ -231,11 +231,10 @@ class EventManager:
newevent.add(handler)
def __getattr__(self, name):
"""
Get an event, if it doesn't already exist.
"""
"""Get an event, if it doesn't already exist."""
# This is only called if the attribute doesn't exist, so create the Event...
e = type(name, (Event,), {'__doc__': None})() # (A little bit of magic to enable docstrings to work right)
# (A little bit of magic to enable docstrings to work right)
e = type(name, (Event,), {'__doc__': None})()
# ... and save it.
setattr(self, name, e)
# Now it exists, and we won't be called again.