Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fa6b11d

Browse files
committed
added docstring, minor cleanup
1 parent bead58b commit fa6b11d

1 file changed

Lines changed: 13 additions & 38 deletions

File tree

bipython/urwid_backend.py

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,32 @@
1+
# Copyright (c) 2014, Paul Ivanov <[email protected]>
2+
# Distributed under the terms of the Modified BSD License.
3+
# The full license is in the LICENSE file distributed with this software.
4+
"""bipython: the boldly indiscriminate Python interpreter
15
2-
#
3-
# The MIT License
4-
#
5-
# Copyright (c) 2010-2011 Marien Zwart
6-
#
7-
# Permission is hereby granted, free of charge, to any person obtaining a copy
8-
# of this software and associated documentation files (the "Software"), to deal
9-
# in the Software without restriction, including without limitation the rights
10-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11-
# copies of the Software, and to permit persons to whom the Software is
12-
# furnished to do so, subject to the following conditions:
13-
#
14-
# The above copyright notice and this permission notice shall be included in
15-
# all copies or substantial portions of the Software.
16-
#
17-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23-
# THE SOFTWARE.
24-
25-
26-
"""bpython backend based on Urwid.
27-
28-
Based on Urwid 0.9.9.
29-
30-
This steals many things from bpython's "cli" backend.
31-
32-
This is still *VERY* rough.
6+
based on bpython backend based on Urwid.
7+
8+
http://bipython.org
339
"""
10+
from __future__ import absolute_import, with_statement, division
3411

12+
__author__ = 'Paul Ivanov ([email protected])'
13+
__copyright__ = 'Copyright (c) 2014 Paul Ivanov'
14+
__license__ = 'BSD'
3515

36-
from __future__ import absolute_import, with_statement, division
3716

3817
import sys
3918
import os
40-
import pydoc
4119
import time
4220
import locale
4321
import signal
4422
from types import ModuleType
4523
from optparse import Option
46-
from glob import glob
4724

4825
from pygments.token import Token
4926

5027
from bpython import args as bpargs, repl, translations
51-
from bpython._py3compat import py3
5228
from bpython.formatter import theme_map
5329
from bpython.importcompletion import find_coroutine
54-
from bpython import importcompletion, inspection
5530
from bpython.translations import _
5631

5732
from bpython.keys import urwid_key_dispatch as key_dispatch
@@ -62,7 +37,7 @@
6237
if not py3:
6338
import inspect
6439

65-
from inspect import ArgSpec
40+
from inspect import ArgSpec # we eval an ArgSpec repr, see ipython_get_argspec
6641

6742
from Queue import Empty
6843

@@ -1267,7 +1242,7 @@ def ipython_get_argspec(self, func):
12671242
self.echod("got an error")
12681243
return None
12691244

1270-
return eval(aspec['data']['text/plain'])
1245+
return eval(aspec['data']['text/plain']) # relies on ArgSpec
12711246

12721247

12731248
def ipython_complete(self, base, current_line, pos=None):

0 commit comments

Comments
 (0)