@ueffel yes, I grebbed the conversions from the Android app RealCalc (an HP-like RPN calculator) and in converting the XML export to my JSON, I dropped the 'offset' and 'inverse' attributes.
@polyvertex I had some weird issues trying to use the pyparsing package - apparently, the way the plugins get reloaded interfere with the use of super(type,self) that is prevalent in that package. Where is the right place to ask dev-related questions?
@ueffel ah yep, so I did misinterpret the data ^^
@DrorHarari_twitter mmh I don't know how pyparsing works under the hood so I cannot confirm. FYI, KP does not keep track of dependencies so only package's
.py modules are reloaded. Which means in your case that pyparsing does not get re-imported by the interpreter. So for instance, if pyparsing creates global variables (i.e. at module-level) and does not offer a way to clean its internal state, you might get into trouble.
@polyvertex Well, I guess it is a general Python issue, internally there is a code such as this:
def init( self, matchString ):
and it crash on the last line in the super() call saying the second parameter (self) should be an instance of the first (which it is the class). Digging into it, the Python internals have two versions of the Literal class with two IDs (because it was reloaded). So I dumped this and used something simpler.
What is the general rule for adding 3'rd party dependencies to my plugin? (something I might have installed with pip). Are there restrictions to what I can bring (other that issues like above) and where do I put those dependencies?
@DrorHarari_twitter it is a Python issue yes, but only if you consider there's no design flaw in pyparsing.
What is the general rule for adding 3'rd party dependencies to my plugin?
Any pure Python package should do, although the lighter the better obviously. Also, it is good practice to store them in a sub-folder, called
lib by convention (like in the TaskSwitcher or Calc package). This is because that way, KP does not have to introspect them at loading time to check if there are some Plugin classes to instanciate. This also makes your code cleaner since you can then use relative import notation as opposed as the absolute one you're currently using in your plugin.
It is also cleaner, but not compulsory, to put data files in a separate sub-folder, like in the URL or WebSuggest package.
paths = D:\tools\**
00:29:13.405 FilesCatalog.FilesCatalog: Cataloged 372 items in 0.0 seconds 00:29:13.405 FilesCatalog.FilesCatalog: Total: 372 items found and cataloged in 5.8 seconds