## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
• Jan 22 07:32
sindzicat edited #532
• Jan 22 07:30
sindzicat edited #532
• Jan 22 07:29
sindzicat opened #532
• Jan 11 19:24
vctls opened #531
• Jan 11 19:13
vctls commented #516
• Jan 06 01:33
DrorHarari opened #46
• Jan 03 20:51
fran-f reopened #526
• Jan 03 20:51
fran-f commented #526
• Jan 03 18:03
Torben2000 commented #526
• Jan 03 12:50
DrorHarari commented #526
• Jan 01 22:02
DrorHarari commented #526
• Jan 01 12:07
DrorHarari commented #526
• Jan 01 11:46
fran-f commented #526
• Dec 19 2021 12:10
DrorHarari commented #265
• Dec 18 2021 23:50
DrorHarari commented #526
• Dec 14 2021 09:41
daniel-liuzzi edited #530
• Dec 14 2021 09:40
daniel-liuzzi edited #530
• Dec 11 2021 23:10
daniel-liuzzi opened #530
• Dec 07 2021 08:11
at-ng commented #410
• Dec 07 2021 08:09
at-ng commented #410
cougarten
@cougarten
@Sergix a late thanks to your reply :) I'll check it out
Dror Harari
Built a new package - https://github.com/DrorHarari/keypirinha-cvt - a universal unit conversion. It's a day old so might be rough - let me know if you find it useful or have ideas for improvement.
JC
@polyvertex
Is it me or both °C and °K both have the same scale?
(there's also Units from @ArmaniKorsich, which looks pretty similar!)
Dror Harari
@polyvertex this plugin supports units of many measurement types: Distance, Area, Volume, Mass, Speed, Time, Force, Pressure, Energy, Power, Fuel Consumption, Temperature and Data Size. Moreover, it is all based on a json config file so it can easily be extended to add other conversions. I looked at Units and learn how this plugin system works but in Units, everything is hard coded so to add measurements, one have to change code. I'm still pretty ignorant about the plugin API and have only played with the Distance measurements - some other measurements like the temperature have 'non-standard' aliases that messes them up (plus conversion rule that is not just proportion). As I said, it's day 1...
JC
@polyvertex
@DrorHarari_twitter just to clarify, my comment about the Units package was meant as a FYI parenthesis as opposed to something like "someone already did that"! I noticed both packages are designed differently and just look similar feature-wise.
One thing I noticed though is that the scale you used for °K that seems to be equal to °C. So I was wondering if I read the data correctly.
Steffen Brüheim
@ueffel
K and °C scale that same. its just the offset. looks right to me
maybe the offset should be negative?
Dror Harari

@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?

Steffen Brüheim
@ueffel
Right here :)
JC
@polyvertex

@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.

Dror Harari

@polyvertex Well, I guess it is a general Python issue, internally there is a code such as this:

class Literal(Token):
def init( self, matchString ):
super(Literal,self).init()

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?

JC
@polyvertex

@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.

ArmaniKorsich
@ArmaniKorsich
@DrorHarari_twitter Yeah I'm just a novice at python and programming in general, it was mostly a tool to help me while I do 3d modelling and cad. Never thought about j-son and config files so if I ever get a chance I might try to redo it. Thank you for making something better!
Dror Harari
@ueffel as this Cvt gets usable, how do I get it listed in you package manager?
Steffen Brüheim
@ueffel
Enter it here:
Dror Harari
I registered but it fails to register - I suspect casing issue (the standard is not clear):
12:18:22.946 Python: AttributeError: 'NoneType' object has no attribute 'name'
12:18:26.660 ** ERROR: PackageControl.PackageControl: Error occurred while executing command 'PackageControl: Install Package'
Traceback (most recent call last):
File "C:\Util\Keypirinha\portable\Profile\InstalledPackages\PackageControl.keypirinha-package\packagecontrol.py", line 215, in on_execute
File "C:\Util\Keypirinha\portable\Profile\InstalledPackages\PackageControl.keypirinha-package\packagecontrol.py", line 457, in _install_package
AttributeError: 'NoneType' object has no attribute 'name'
Steffen Brüheim
@ueffel
hm it worked fine for me. did you run PackageControl: Update Repository List?
Dror Harari
Strange - it now works for me. I removed and re-added both PackageControl and Cvt. It works for me now without that exception.
JC
@polyvertex
Would some of you be interested in having their history exportable to an SQLite database? I'm asking because I'm currently considering modifying history's storage format (currently JSON) to something more privacy-safe. But a feature to export the history would be close to zero to implement so why not... (I see it coming that some of you would be happy to even alter it before having KP to import it :) )
JC
@polyvertex
Note that the history file contains your keyword associations as well.
Steffen Brüheim
@ueffel
Would be nice if the history could exported and imported
JC
@polyvertex
What for?
Steffen Brüheim
@ueffel
sometimes my windows bluescreens while shutting down. at the next bootup the keypirinha history is usually corrupted, among other things that were running at shutdown time
so all my keywords are gone
JC
@polyvertex
This is surprising. KP does not keep the file open at runtime. File is fully rewritten when you execute an item for example, but file handle is released immediately after write, which causes the file to be updated at FS-level... The whole operation lasts for a few milliseconds. Caching issue? Meh...
JC
@polyvertex
Do you use KP to command a shutdown perhaps?
(but that would mean BSOD pops up immediately after hitting Enter)
Dror Harari
Definitely will be good to be able to export if encrypted but why not have the export format be the same JSON format which is now used? What's the benefit in exporting to SQLite? In fact, if privacy is the main concern (especially on a portable storage - assuming only the user who created it should be able to read/export it), then the easiest way to do it would be to simply encrypt the history file on write with a master key derived from a user password. The only further trick necessary is to have an extra file which contains a dictionary from the machine NETBIOS name to the encrypted form of the master key that you get with CryptProtectData (using the User or Machine). The first time one uses this on a new machine, they enter the password and then it's no longer needed.
Steffen Brüheim
@ueffel
@polyvertex yes i shutdown via KP, of course :D
Pavel Ordenko
@niberius
Hello! Can someone please help me with FilesCatalog plugin? I configured the plugin, but when I try to type some file name in KP, I got nothing. Probably I'm missing something? I tried to restart KP and "Refresh catalog" option, but it not helps. The filescatalog.ini content is following
[profile/Tools]
activate = yes
include_hidden = no
include_dirs = no
include_files = yes
filters = + ext: .exe .bat .cmd
paths = D:\tools
max_depth = 10
Steffen Brüheim
@ueffel
looks right to me. do have something like "FilesCatalog.FilesCatalog: Profile Tools: found 739 items in 0.1 seconds" in your Keypirinha: Console?
Pavel Ordenko
@niberius
Hmmmm, strange...
00:20:19.997 FilesCatalog.FilesCatalog: Profile Tools: found 0 items in 0.1 seconds
00:20:20.001 FilesCatalog.FilesCatalog: Total: 0 items found and cataloged in 0.1 seconds
Steffen Brüheim
@ueffel
ah
try paths = D:\tools\**
Pavel Ordenko
@niberius
Cool, thanks a lot for your help! I didn't notice such thing on the official site or in config comments, but it helps, thanks one more time! :D
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
JC
@polyvertex
@DrorHarari_twitter I'm considering improving the internal structure of history a little, which incidentally impacts the way it is stored. With the new planned structure, JSON does not fit anymore. I will maybe just serialize the history in a raw format like it is the case for the catalog already. But I wanted the user to be able to keep an eye on the content of the history, like the JSON format currently allows to do. So in addition to raw format, I throw the export feature idea here...
So the point is not to "secure" KP per-se, there's little sense in that since it's plugin-oriented. But yes it still improves privacy to make the output format less readable by default.
@ueffel so does the BSOD pops up right after you execute the shutdown command?
JC
@polyvertex
@ueffel #321
Steffen Brüheim
@ueffel
@polyvertex no it does not pop up immediately. There are a few seconds with the logout screen where it says "system shutting down" or something
cougarten
Hi. Can i somehow keep the results from unloading until the next results are available?
when I "home in" with "everything"-search, I'd prefer the results to simply change instead of flickering in and out of existance
Michael J Gerace
@mjgerace
Can someone clear something up for me: is Piranha not open source?
Dror Harari