Show More
@@ -450,7 +450,7 b' class FileLinks(FileLink):' | |||
|
450 | 450 | display_fnames = [] |
|
451 | 451 | for fname in fnames: |
|
452 | 452 | if (isfile(join(dirname,fname)) and |
|
453 |
(included_suffixes |
|
|
453 | (included_suffixes is None or | |
|
454 | 454 | splitext(fname)[1] in included_suffixes)): |
|
455 | 455 | display_fnames.append(fname) |
|
456 | 456 |
@@ -116,7 +116,7 b' class MagicHelper(QtGui.QDockWidget):' | |||
|
116 | 116 | instance is expected to invoke populate_magic_helper() when magic |
|
117 | 117 | info is available. |
|
118 | 118 | """ |
|
119 |
if not visible or self.data |
|
|
119 | if not visible or self.data is not None: | |
|
120 | 120 | return |
|
121 | 121 | self.data = {} |
|
122 | 122 | self.search_class.clear() |
@@ -178,14 +178,14 b' class MagicHelper(QtGui.QDockWidget):' | |||
|
178 | 178 | """Emit pasteRequested signal with currently selected item text |
|
179 | 179 | """ |
|
180 | 180 | text = self._get_current_search_item(item) |
|
181 |
if text |
|
|
181 | if text is not None: | |
|
182 | 182 | self.pasteRequested.emit(text) |
|
183 | 183 | |
|
184 | 184 | def run_requested(self, item = None): |
|
185 | 185 | """Emit runRequested signal with currently selected item text |
|
186 | 186 | """ |
|
187 | 187 | text = self._get_current_search_item(item) |
|
188 |
if text |
|
|
188 | if text is not None: | |
|
189 | 189 | self.runRequested.emit(text) |
|
190 | 190 | |
|
191 | 191 | def filter_magic_helper(self, regex, cls): |
@@ -193,9 +193,9 b' class MagicHelper(QtGui.QDockWidget):' | |||
|
193 | 193 | regex and class match cls. |
|
194 | 194 | If cls equals 'any' - any class matches. |
|
195 | 195 | """ |
|
196 |
if regex == "" or regex |
|
|
196 | if regex == "" or regex is None: | |
|
197 | 197 | regex = '.' |
|
198 |
if cls |
|
|
198 | if cls is None: | |
|
199 | 199 | cls = 'any' |
|
200 | 200 | |
|
201 | 201 | self.search_list.clear() |
@@ -144,7 +144,7 b' class MainWindow(QtGui.QMainWindow):' | |||
|
144 | 144 | # of this is when 'exit' is sent in a slave tab. 'exit' will be |
|
145 | 145 | # re-sent by this function on the master widget, which ask all slave |
|
146 | 146 | # widgets to exit |
|
147 |
if closing_widget |
|
|
147 | if closing_widget is None: | |
|
148 | 148 | return |
|
149 | 149 | |
|
150 | 150 | #get a list of all slave widgets on the same kernel. |
@@ -719,12 +719,12 b' class MainWindow(QtGui.QMainWindow):' | |||
|
719 | 719 | QtCore.QTimer.singleShot(200, self.active_frontend._control.setFocus) |
|
720 | 720 | |
|
721 | 721 | def magic_helper_paste_requested(self, text = None): |
|
722 |
if text |
|
|
722 | if text is not None: | |
|
723 | 723 | self.active_frontend.input_buffer = text |
|
724 | 724 | self._set_active_frontend_focus() |
|
725 | 725 | |
|
726 | 726 | def magic_helper_run_requested(self, text = None): |
|
727 |
if text |
|
|
727 | if text is not None: | |
|
728 | 728 | self.active_frontend.execute(text) |
|
729 | 729 | self._set_active_frontend_focus() |
|
730 | 730 |
@@ -296,7 +296,7 b' class Win32ShellCommandController(object):' | |||
|
296 | 296 | c_hstdin = None |
|
297 | 297 | CloseHandle(c_hstdout) |
|
298 | 298 | c_hstdout = None |
|
299 |
if c_hstderr |
|
|
299 | if c_hstderr is not None: | |
|
300 | 300 | CloseHandle(c_hstderr) |
|
301 | 301 | c_hstderr = None |
|
302 | 302 | |
@@ -403,10 +403,10 b' class Win32ShellCommandController(object):' | |||
|
403 | 403 | These functions are called from different threads (but not |
|
404 | 404 | concurrently, because of the GIL). |
|
405 | 405 | """ |
|
406 |
if stdout_func |
|
|
406 | if stdout_func is None and stdin_func is None and stderr_func is None: | |
|
407 | 407 | return self._run_stdio() |
|
408 | 408 | |
|
409 |
if stderr_func |
|
|
409 | if stderr_func is not None and self.mergeout: | |
|
410 | 410 | raise RuntimeError("Shell command was initiated with " |
|
411 | 411 | "merged stdin/stdout, but a separate stderr_func " |
|
412 | 412 | "was provided to the run() method") |
@@ -421,7 +421,7 b' class Win32ShellCommandController(object):' | |||
|
421 | 421 | threads.append(threading.Thread(target=self._stdout_thread, |
|
422 | 422 | args=(self.hstdout, stdout_func))) |
|
423 | 423 | if not self.mergeout: |
|
424 |
if stderr_func |
|
|
424 | if stderr_func is None: | |
|
425 | 425 | stderr_func = stdout_func |
|
426 | 426 | threads.append(threading.Thread(target=self._stdout_thread, |
|
427 | 427 | args=(self.hstderr, stderr_func))) |
@@ -541,7 +541,7 b' class Win32ShellCommandController(object):' | |||
|
541 | 541 | if self.hstderr: |
|
542 | 542 | CloseHandle(self.hstderr) |
|
543 | 543 | self.hstderr = None |
|
544 |
if self.piProcInfo |
|
|
544 | if self.piProcInfo is not None: | |
|
545 | 545 | CloseHandle(self.piProcInfo.hProcess) |
|
546 | 546 | CloseHandle(self.piProcInfo.hThread) |
|
547 | 547 | self.piProcInfo = None |
General Comments 0
You need to be logged in to leave comments.
Login now