| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 04a14d7 commit 4442a75
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,6 +15,7 @@ | |||
| 15 | 15 | from bpython.curtsiesfrontend.coderunner import SystemExitFromCodeGreenlet | |
| 16 | 16 | from bpython import args as bpargs | |
| 17 | 17 | from bpython.translations import _ | |
| 18 | + from bpython.importcompletion import find_iterator | ||
| 18 | 19 | ||
| 19 | 20 | def main(args=None, locals_=None, banner=None): | |
| 20 | 21 | config, options, exec_args = bpargs.parse(args, ( | |
@@ -78,7 +79,7 @@ def process_event(e): | |||
| 78 | 79 | process_event(paste) | |
| 79 | 80 | ||
| 80 | 81 | while True: | |
| 81 | - process_event(tc.get_event()) | ||
| 82 | + process_event(tc.get_event(idle=find_iterator)) | ||
| 82 | 83 | ||
| 83 | 84 | if __name__ == '__main__': | |
| 84 | 85 | sys.exit(main()) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -220,7 +220,6 @@ def smarter_request_refresh(): | |||
| 220 | 220 | ||
| 221 | 221 | self.width = None # will both be set by a window resize event | |
| 222 | 222 | self.height = None | |
| 223 | - self.start_background_tasks() | ||
| 224 | 223 | ||
| 225 | 224 | def __enter__(self): | |
| 226 | 225 | self.orig_stdout = sys.stdout | |
@@ -236,18 +235,6 @@ def __exit__(self, *args): | |||
| 236 | 235 | sys.stdout = self.orig_stdout | |
| 237 | 236 | sys.stderr = self.orig_stderr | |
| 238 | 237 | ||
| 239 | - def start_background_tasks(self): | ||
| 240 | - """starts tasks that should run on startup in the background""" | ||
| 241 | - | ||
| 242 | - def importcompletion_thread(): | ||
| 243 | - #TODO use locks or something to avoid error on import completion right at startup | ||
| 244 | - while importcompletion.find_coroutine(): # returns None when fully initialized | ||
| 245 | - pass | ||
| 246 | - | ||
| 247 | - t = threading.Thread(target=importcompletion_thread) | ||
| 248 | - t.daemon = True | ||
| 249 | - t.start() | ||
| 250 | - | ||
| 251 | 238 | def clean_up_current_line_for_exit(self): | |
| 252 | 239 | """Called when trying to exit to prep for final paint""" | |
| 253 | 240 | logging.debug('unhighlighting paren for exit') | |
@@ -946,6 +933,7 @@ def request_refresh(): | |||
| 946 | 933 | r.width = 50 | |
| 947 | 934 | r.height = 10 | |
| 948 | 935 | while True: | |
| 936 | + [_ for _ in importcompletion.find_iterator] | ||
| 949 | 937 | r.dumb_print_output() | |
| 950 | 938 | r.dumb_input(refreshes) | |
| 951 | 939 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,9 +53,6 @@ def complete(line, cw): | |||
| 53 | 53 | if not cw: | |
| 54 | 54 | return None | |
| 55 | 55 | ||
| 56 | - if not fully_loaded: | ||
| 57 | - return [] | ||
| 58 | - | ||
| 59 | 56 | tokens = line.split() | |
| 60 | 57 | if tokens[0] not in ['from', 'import']: | |
| 61 | 58 | return None | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -153,7 +153,7 @@ def initialize_options(self): | |||
| 153 | 153 | 'pygments' | |
| 154 | 154 | ], | |
| 155 | 155 | extras_require = { | |
| 156 | - 'curtsies': ['curtsies>=0.0.27', 'greenlet'], | ||
| 156 | + 'curtsies': ['curtsies>=0.0.28', 'greenlet'], | ||
| 157 | 157 | 'urwid' : ['urwid'] | |
| 158 | 158 | }, | |
| 159 | 159 | tests_require = ['mock'], | |
| Back | FazBrowse Home | New Git URL |
0 commit comments