Sundance wrote: > As time allows, yes, with pleasure. No promise about how successful > it's gonna be, though, seeing as we're talking badass advanced snake > charming here; we'll see how that goes.
... Ooooookay. This was even worse than I imagined, but I'm done and, crazily enough, it seems to work. Here's how it works. 1) Drop the attached source file in the debugger's directory; 2) Surround the imports to be quarantined with the code that loads and turns the quarantined import on, then off. For instance: ---[ Unquarantined imports ]------------------------------------------- import A import B from C import D ----------------------------------------------------------------------- ... becomes... ---[ Quarantined imports ]--------------------------------------------- from QuarantinedImport import quarantined_import quarantined_import.on() import A import B from C import D quarantined_import.off() ----------------------------------------------------------------------- In Eric's case, that would make it: ---[ DebugClientBase.py excerpt ]-------------------------------------- [...] from QuarantinedImport import quarantined_import quarantined_import.on() from DebugProtocol import * import DebugClientCapabilities from DebugBase import printerr from AsyncFile import * from Config import ConfigVarTypeStrings from FlexCompleter import Completer quarantined_import.off() [...] ----------------------------------------------------------------------- And yeah, that's it. Warning: this tool is pure evil, it comes with no warranty whatsoever and may eat kittens and/or puppies. Also, if there's a module that does some very important things at load time that must only happen once, all hell will likely break loose if you import that module both inside and outside the quarantined zone. Consider yourself warned. Feedback very welcome! -- S.
QuarantinedImport.py
Description: application/python
_______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
