Show More
@@ -401,13 +401,16 b' class DirectView(View):' | |||
|
401 | 401 | return self.sync_imports(True) |
|
402 | 402 | |
|
403 | 403 | @contextmanager |
|
404 | def sync_imports(self, local=True): | |
|
404 | def sync_imports(self, local=True, quiet=False): | |
|
405 | 405 | """Context Manager for performing simultaneous local and remote imports. |
|
406 | 406 | |
|
407 | 407 | 'import x as y' will *not* work. The 'as y' part will simply be ignored. |
|
408 | 408 | |
|
409 | 409 | If `local=True`, then the package will also be imported locally. |
|
410 | 410 | |
|
411 | If `quiet=True`, then no message concerning the success of import will be | |
|
412 | reported. | |
|
413 | ||
|
411 | 414 | Note that remote-only (`local=False`) imports have not been implemented. |
|
412 | 415 | |
|
413 | 416 | >>> with view.sync_imports(): |
@@ -456,6 +459,7 b' class DirectView(View):' | |||
|
456 | 459 | key = name+':'+','.join(fromlist or []) |
|
457 | 460 | if level == -1 and key not in modules: |
|
458 | 461 | modules.add(key) |
|
462 | if not quiet: | |
|
459 | 463 | if fromlist: |
|
460 | 464 | print "importing %s from %s on engine(s)"%(','.join(fromlist), name) |
|
461 | 465 | else: |
General Comments 0
You need to be logged in to leave comments.
Login now