| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b4424a3 commit 8f03ee2
32 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,7 @@ | |||
| 7 | 7 | pydoc.pager = page | |
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | - class _Helper(object): | ||
| 10 | + class _Helper: | ||
| 11 | 11 | def __init__(self): | |
| 12 | 12 | if hasattr(pydoc.Helper, "output"): | |
| 13 | 13 | # See issue #228 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -149,7 +149,7 @@ def method_match_fuzzy(word, size, text): | |||
| 149 | 149 | } | |
| 150 | 150 | ||
| 151 | 151 | ||
| 152 | - class BaseCompletionType(object): | ||
| 152 | + class BaseCompletionType: | ||
| 153 | 153 | """Describes different completion types""" | |
| 154 | 154 | ||
| 155 | 155 | def __init__(self, shown_before_tab=True, mode=SIMPLE): | |
@@ -209,7 +209,7 @@ def __init__(self, completers, mode=SIMPLE): | |||
| 209 | 209 | ) | |
| 210 | 210 | self._completers = completers | |
| 211 | 211 | ||
| 212 | - super(CumulativeCompleter, self).__init__(True, mode) | ||
| 212 | + super().__init__(True, mode) | ||
| 213 | 213 | ||
| 214 | 214 | def locate(self, current_offset, line): | |
| 215 | 215 | return self._completers[0].locate(current_offset, line) | |
@@ -244,7 +244,7 @@ def format(self, word): | |||
| 244 | 244 | ||
| 245 | 245 | class FilenameCompletion(BaseCompletionType): | |
| 246 | 246 | def __init__(self, mode=SIMPLE): | |
| 247 | - super(FilenameCompletion, self).__init__(False, mode) | ||
| 247 | + super().__init__(False, mode) | ||
| 248 | 248 | ||
| 249 | 249 | def safe_glob(self, pathname): | |
| 250 | 250 | return glob.iglob(glob.escape(pathname) + "*") | |
@@ -567,7 +567,7 @@ def matches(self, cursor_offset, line, **kwargs): | |||
| 567 | 567 | cursor_offset, | |
| 568 | 568 | line, | |
| 569 | 569 | ) | |
| 570 | - results = super(MultilineJediCompletion, self).matches( | ||
| 570 | + results = super().matches( | ||
| 571 | 571 | cursor_offset, line, history=history | |
| 572 | 572 | ) | |
| 573 | 573 | return results | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -121,7 +121,7 @@ def newfunc(self, *args, **kwargs): | |||
| 121 | 121 | return newfunc | |
| 122 | 122 | ||
| 123 | 123 | ||
| 124 | - class FakeStream(object): | ||
| 124 | + class FakeStream: | ||
| 125 | 125 | """Provide a fake file object which calls functions on the interface | |
| 126 | 126 | provided.""" | |
| 127 | 127 | ||
@@ -147,7 +147,7 @@ def flush(self): | |||
| 147 | 147 | self.interface.flush() | |
| 148 | 148 | ||
| 149 | 149 | ||
| 150 | - class FakeStdin(object): | ||
| 150 | + class FakeStdin: | ||
| 151 | 151 | """Provide a fake stdin type for things like raw_input() etc.""" | |
| 152 | 152 | ||
| 153 | 153 | def __init__(self, interface): | |
@@ -303,7 +303,7 @@ def make_colors(config): | |||
| 303 | 303 | ||
| 304 | 304 | class CLIInteraction(repl.Interaction): | |
| 305 | 305 | def __init__(self, config, statusbar=None): | |
| 306 | - super(CLIInteraction, self).__init__(config, statusbar) | ||
| 306 | + super().__init__(config, statusbar) | ||
| 307 | 307 | ||
| 308 | 308 | def confirm(self, q): | |
| 309 | 309 | """Ask for yes or no and return boolean""" | |
@@ -323,7 +323,7 @@ def file_prompt(self, s): | |||
| 323 | 323 | ||
| 324 | 324 | class CLIRepl(repl.Repl): | |
| 325 | 325 | def __init__(self, scr, interp, statusbar, config, idle=None): | |
| 326 | - super(CLIRepl, self).__init__(interp, config) | ||
| 326 | + super().__init__(interp, config) | ||
| 327 | 327 | self.interp.writetb = self.writetb | |
| 328 | 328 | self.scr = scr | |
| 329 | 329 | self.stdout_hist = "" # native str (bytes in Py2, unicode in Py3) | |
@@ -1527,7 +1527,7 @@ def send_current_line_to_editor(self): | |||
| 1527 | 1527 | return "" | |
| 1528 | 1528 | ||
| 1529 | 1529 | ||
| 1530 | - class Statusbar(object): | ||
| 1530 | + class Statusbar: | ||
| 1531 | 1531 | """This class provides the status bar at the bottom of the screen. | |
| 1532 | 1532 | It has message() and prompt() methods for user interactivity, as | |
| 1533 | 1533 | well as settext() and clear() methods for changing its appearance. | |
@@ -1821,7 +1821,7 @@ def do_resize(caller): | |||
| 1821 | 1821 | # The list win resizes itself every time it appears so no need to do it here. | |
| 1822 | 1822 | ||
| 1823 | 1823 | ||
| 1824 | - class FakeDict(object): | ||
| 1824 | + class FakeDict: | ||
| 1825 | 1825 | """Very simple dict-alike that returns a constant value for any key - | |
| 1826 | 1826 | used as a hacky solution to using a colours dict containing colour codes if | |
| 1827 | 1827 | colour initialisation fails.""" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,7 +31,7 @@ class CopyFailed(Exception): | |||
| 31 | 31 | pass | |
| 32 | 32 | ||
| 33 | 33 | ||
| 34 | - class XClipboard(object): | ||
| 34 | + class XClipboard: | ||
| 35 | 35 | """Manage clipboard with xclip.""" | |
| 36 | 36 | ||
| 37 | 37 | def copy(self, content): | |
@@ -43,7 +43,7 @@ def copy(self, content): | |||
| 43 | 43 | raise CopyFailed() | |
| 44 | 44 | ||
| 45 | 45 | ||
| 46 | - class OSXClipboard(object): | ||
| 46 | + class OSXClipboard: | ||
| 47 | 47 | """Manage clipboard with pbcopy.""" | |
| 48 | 48 | ||
| 49 | 49 | def copy(self, content): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,7 @@ | |||
| 8 | 8 | from .autocomplete import SIMPLE as default_completion, ALL_MODES | |
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | - class Struct(object): | ||
| 11 | + class Struct: | ||
| 12 | 12 | """Simple class for instantiating objects we can add arbitrary attributes | |
| 13 | 13 | to and use for various arbitrary things.""" | |
| 14 | 14 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -59,7 +59,7 @@ def __init__(self, config, locals_, banner, interp=None): | |||
| 59 | 59 | with self.input_generator: | |
| 60 | 60 | pass # temp hack to get .original_stty | |
| 61 | 61 | ||
| 62 | - super(FullCurtsiesRepl, self).__init__( | ||
| 62 | + super().__init__( | ||
| 63 | 63 | locals_=locals_, | |
| 64 | 64 | config=config, | |
| 65 | 65 | banner=banner, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,7 +26,7 @@ | |||
| 26 | 26 | from bpython.repl import getpreferredencoding | |
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | - class NopPydocPager(object): | ||
| 29 | + class NopPydocPager: | ||
| 30 | 30 | def __enter__(self): | |
| 31 | 31 | self._orig_pager = pydoc.pager | |
| 32 | 32 | pydoc.pager = self | |
@@ -43,17 +43,17 @@ def __init__(self, repl=None): | |||
| 43 | 43 | self._repl = repl | |
| 44 | 44 | pydoc.pager = self.pager | |
| 45 | 45 | ||
| 46 | - super(_Helper, self).__init__() | ||
| 46 | + super().__init__() | ||
| 47 | 47 | ||
| 48 | 48 | def pager(self, output): | |
| 49 | 49 | self._repl.pager(output) | |
| 50 | 50 | ||
| 51 | 51 | def __call__(self, *args, **kwargs): | |
| 52 | 52 | if self._repl.reevaluating: | |
| 53 | 53 | with NopPydocPager(): | |
| 54 | - return super(_Helper, self).__call__(*args, **kwargs) | ||
| 54 | + return super().__call__(*args, **kwargs) | ||
| 55 | 55 | else: | |
| 56 | - return super(_Helper, self).__call__(*args, **kwargs) | ||
| 56 | + return super().__call__(*args, **kwargs) | ||
| 57 | 57 | ||
| 58 | 58 | ||
| 59 | 59 | # vim: sw=4 ts=4 sts=4 ai et | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,7 +25,7 @@ def is_main_thread(): | |||
| 25 | 25 | return threading.main_thread() == threading.current_thread() | |
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | - class SigintHappened(object): | ||
| 28 | + class SigintHappened: | ||
| 29 | 29 | """If this class is returned, a SIGINT happened while the main greenlet""" | |
| 30 | 30 | ||
| 31 | 31 | ||
@@ -34,7 +34,7 @@ class SystemExitFromCodeRunner(SystemExit): | |||
| 34 | 34 | greenlet""" | |
| 35 | 35 | ||
| 36 | 36 | ||
| 37 | - class RequestFromCodeRunner(object): | ||
| 37 | + class RequestFromCodeRunner: | ||
| 38 | 38 | """Message from the code runner""" | |
| 39 | 39 | ||
| 40 | 40 | ||
@@ -61,7 +61,7 @@ def __init__(self, args): | |||
| 61 | 61 | self.args = args | |
| 62 | 62 | ||
| 63 | 63 | ||
| 64 | - class CodeRunner(object): | ||
| 64 | + class CodeRunner: | ||
| 65 | 65 | """Runs user code in an interpreter. | |
| 66 | 66 | ||
| 67 | 67 | Running code requests a refresh by calling | |
@@ -206,7 +206,7 @@ def request_from_main_context(self, force_refresh=False): | |||
| 206 | 206 | return value | |
| 207 | 207 | ||
| 208 | 208 | ||
| 209 | - class FakeOutput(object): | ||
| 209 | + class FakeOutput: | ||
| 210 | 210 | def __init__(self, coderunner, on_write, real_fileobj): | |
| 211 | 211 | """Fakes sys.stdout or sys.stderr | |
| 212 | 212 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,7 +28,7 @@ class ScheduledRefreshRequestEvent(curtsies.events.ScheduledEvent): | |||
| 28 | 28 | for a few seconds""" | |
| 29 | 29 | ||
| 30 | 30 | def __init__(self, when): | |
| 31 | - super(ScheduledRefreshRequestEvent, self).__init__(when) | ||
| 31 | + super().__init__(when) | ||
| 32 | 32 | ||
| 33 | 33 | def __repr__(self): | |
| 34 | 34 | return "<RefreshRequestEvent for %s seconds from now>" % ( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,7 +47,7 @@ def __init__( | |||
| 47 | 47 | self.request_refresh = request_refresh | |
| 48 | 48 | self.schedule_refresh = schedule_refresh | |
| 49 | 49 | ||
| 50 | - super(StatusBar, self).__init__(config) | ||
| 50 | + super().__init__(config) | ||
| 51 | 51 | ||
| 52 | 52 | def push_permanent_message(self, msg): | |
| 53 | 53 | self._message = "" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments