Show More
@@ -75,7 +75,7 b' sys.meta_path.insert(0, ID)' | |||
|
75 | 75 | |
|
76 | 76 | def commit_api(api): |
|
77 | 77 | """Commit to a particular API, and trigger ImportErrors on subsequent |
|
78 |
|
|
|
78 | dangerous imports""" | |
|
79 | 79 | modules = set(api_to_module.values()) |
|
80 | 80 | |
|
81 | 81 | modules.remove(api_to_module[api]) |
@@ -115,15 +115,15 b' def loaded_api():' | |||
|
115 | 115 | def has_binding(api): |
|
116 | 116 | """Safely check for PyQt4/5, PySide or PySide2, without importing submodules |
|
117 | 117 | |
|
118 |
|
|
|
119 |
|
|
|
120 |
|
|
|
121 |
|
|
|
118 | Parameters | |
|
119 | ---------- | |
|
120 | api : str [ 'pyqtv1' | 'pyqt' | 'pyqt5' | 'pyside' | 'pyside2' | 'pyqtdefault'] | |
|
121 | Which module to check for | |
|
122 | 122 | |
|
123 |
|
|
|
124 |
|
|
|
125 |
|
|
|
126 |
|
|
|
123 | Returns | |
|
124 | ------- | |
|
125 | True if the relevant module appears to be importable | |
|
126 | """ | |
|
127 | 127 | module_name = api_to_module[api] |
|
128 | 128 | from importlib.util import find_spec |
|
129 | 129 | |
@@ -193,9 +193,8 b' def import_pyqt4(version=2):' | |||
|
193 | 193 | Parameters |
|
194 | 194 | ---------- |
|
195 | 195 | version : 1, 2, or None |
|
196 | Which QString/QVariant API to use. Set to None to use the system | |
|
197 | default | |
|
198 | ||
|
196 | Which QString/QVariant API to use. Set to None to use the system | |
|
197 | default | |
|
199 | 198 | ImportErrors raised within this function are non-recoverable |
|
200 | 199 | """ |
|
201 | 200 | # The new-style string API (version=2) automatically |
@@ -319,13 +318,12 b' def load_qt(api_options):' | |||
|
319 | 318 | |
|
320 | 319 | Parameters |
|
321 | 320 | ---------- |
|
322 | api_options: List of strings | |
|
321 | api_options : List of strings | |
|
323 | 322 | The order of APIs to try. Valid items are 'pyside', 'pyside2', |
|
324 | 323 | 'pyqt', 'pyqt5', 'pyqtv1' and 'pyqtdefault' |
|
325 | 324 | |
|
326 | 325 | Returns |
|
327 | 326 | ------- |
|
328 | ||
|
329 | 327 | A tuple of QtCore, QtGui, QtSvg, QT_API |
|
330 | 328 | The first three are the Qt modules. The last is the |
|
331 | 329 | string indicating which module was loaded. |
@@ -116,7 +116,7 b' class BackgroundJobManager(object):' | |||
|
116 | 116 | The given expression is passed to eval(), along with the optional |
|
117 | 117 | global/local dicts provided. If no dicts are given, they are |
|
118 | 118 | extracted automatically from the caller's frame. |
|
119 | ||
|
119 | ||
|
120 | 120 | A Python statement is NOT a valid eval() expression. Basically, you |
|
121 | 121 | can only use as an eval() argument something which can go on the right |
|
122 | 122 | of an '=' sign and be assigned to a variable. |
@@ -239,7 +239,7 b' class Demo(object):' | |||
|
239 | 239 | terminal16m |
|
240 | 240 | |
|
241 | 241 | - style('default'): a string of pygments style name to be used. |
|
242 |
|
|
|
242 | """ | |
|
243 | 243 | if hasattr(src, "read"): |
|
244 | 244 | # It seems to be a file or a file-like object |
|
245 | 245 | self.fname = "from a file-like object" |
@@ -517,20 +517,20 b' class FileLinks(FileLink):' | |||
|
517 | 517 | fp_cleaner=None): |
|
518 | 518 | """ generate built-in formatter function |
|
519 | 519 | |
|
520 |
|
|
|
521 |
|
|
|
522 | ||
|
523 |
|
|
|
524 |
|
|
|
525 |
|
|
|
526 |
|
|
|
527 |
|
|
|
528 |
|
|
|
529 |
|
|
|
530 |
|
|
|
531 |
|
|
|
532 |
|
|
|
533 |
|
|
|
520 | this is used to define both the notebook and terminal built-in | |
|
521 | formatters as they only differ by some wrapper text for each entry | |
|
522 | ||
|
523 | dirname_output_format: string to use for formatting directory | |
|
524 | names, dirname will be substituted for a single "%s" which | |
|
525 | must appear in this string | |
|
526 | fname_output_format: string to use for formatting file names, | |
|
527 | if a single "%s" appears in the string, fname will be substituted | |
|
528 | if two "%s" appear in the string, the path to fname will be | |
|
529 | substituted for the first and fname will be substituted for the | |
|
530 | second | |
|
531 | fp_format: string to use for formatting filepaths, must contain | |
|
532 | exactly two "%s" and the dirname will be substituted for the first | |
|
533 | and fname will be substituted for the second | |
|
534 | 534 | """ |
|
535 | 535 | def f(dirname, fnames, included_suffixes=None): |
|
536 | 536 | result = [] |
General Comments 0
You need to be logged in to leave comments.
Login now