Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Keypirinha search user defined folder #314

Closed
DutchPete opened this Issue Sep 8, 2018 · 20 comments

Comments

Projects
None yet
3 participants
@DutchPete
Copy link

DutchPete commented Sep 8, 2018

I am new to Keypirinha (Kp), using the portable version. I have a folder with portable apps that Kp does not search in. I understand it can be added to the configuration file. I have tried the following:

[main]
extra_paths =
C:\Users\Peter\Standalone apps**

Note: the 3rd line is indented
After saving the config file, I exited Kp, relaunched it, but it still does not search in that folder. I tried to put Standalone apps between double quotes, no luck either.
Please advise.

@polyvertex

This comment has been minimized.

Copy link
Member

polyvertex commented Sep 9, 2018

extra_paths setting has been obsoleted by the FilesCatalog package.
Just undo the config you mentioned, then configure the FilesCatalog package with the following and you should be fine:

[profile/PortableApps]
activate = yes
inherit = ExeOnly
paths = C:\Users\Peter\Standalone apps\**

Note that if Keypirinha is also installed in your C:\Users\Peter\Standalone apps\ folder, you can specify the following value for the paths setting:

paths = ${var:APP_DIR}\..\**

Also, the optional ExeOnly value indicates you want only executable files like .exe or scripts to be cataloged.

@DutchPete

This comment has been minimized.

Copy link
Author

DutchPete commented Sep 9, 2018

Jean-Charles, merci beaucoup. I did what you suggested but it still does not work.
Please click on the link and you will see the modifications I have applied to Kp. Please tell me what I did wrong, and forgive me if I annoy you with basic questions.

https://imgur.com/n7RO04d

@ueffel

This comment has been minimized.

Copy link

ueffel commented Sep 9, 2018

You have to launch Keypirinha: Configure Package: FilesCatalog and enter the configuration snippet there.

@DutchPete

This comment has been minimized.

Copy link
Author

DutchPete commented Sep 9, 2018

Many thanks, that works !!
There are 1 or 2 other non-standard paths I want Kp to search too, so I thought I could just add those paths below it.

So, I added 2 more lines right below what you indicated. This is what I did:

[profile/PortableApps] activate = yes inherit = ExeOnly paths = C:\Users\Peter\Standalone apps\** paths = Q:\** paths = C:\Users\Peter\AppData\Roaming\**

Q is my virtual VeraCrypt drive.

BTW, excuse my ignorance but I don't know how to get the code commands above on separate lines :-(( In any case, in the FilesCatalog package my 2 new lines are each on a separate line right below the last one, no gaps. My apologies.

Kp does not recognise the newly added lines, although the FilesCatalog seems to be the right place.

@ueffel

This comment has been minimized.

Copy link

ueffel commented Sep 9, 2018

You have to do it like that:

[profile/PortableApps] 
activate = yes 
inherit = ExeOnly 
paths = 
    C:\Users\Peter\Standalone apps\** 
    Q:\** 
    C:\Users\Peter\AppData\Roaming\**

For code formatting see https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code or https://help.github.com/articles/creating-and-highlighting-code-blocks/ the ini snippets are inserted like that:

```ini
[section]
key = value
```
@DutchPete

This comment has been minimized.

Copy link
Author

DutchPete commented Sep 9, 2018

I assume that the indentation of each of those 3 lines is done by 1 click on the tab key. But when I do that Kp does not pick it up.

Thanks for the Github formatting links.

@ueffel

This comment has been minimized.

Copy link

ueffel commented Sep 9, 2018

It should work, anything in the Keypirinha Console? I have the following profile working flawlessly for me:

[profile/Tools]
paths =
    C:\Git\**
    C:\Gow\**
    C:\SysInternals\**
inherit = ExeOnly
max_depth = 3
activate = yes

the indentation can be spaces or tabs, it does not matter.

@DutchPete

This comment has been minimized.

Copy link
Author

DutchPete commented Sep 9, 2018

This is what I found in the Console:

ERROR: Error from FilesCatalog.FilesCatalog.on_events: <class 'IndexError'>: string index out of range
Traceback (most recent call last):
File "C:\Users\Peter\Standalone apps\Keypirinha\default\Packages\FilesCatalog.keypirinha-package\filescatalog.py", line 356, in on_events
File "C:\Users\Peter\Standalone apps\Keypirinha\default\Packages\FilesCatalog.keypirinha-package\filescatalog.py", line 311, in on_catalog
File "C:\Users\Peter\Standalone apps\Keypirinha\default\Packages\FilesCatalog.keypirinha-package\filescatalog.py", line 194, in default_scan_callback
File "C:\Users\Peter\Standalone apps\Keypirinha\python\site\globex.py", line 45, in is_hidden
return is_hidden(self)
File "C:\Users\Peter\Standalone apps\Keypirinha\python\site\globex.py", line 303, in is_hidden
if pathname_or_entry.name[0] in DOT:

I then altered the code in the FilesCatalog package by changing [profile/PortableApps] into [profile/Tools], so that I now have:

[profile/Tools]
activate = yes
paths =
    C:\Users\Peter\Standalone apps\**
    Q:\** 
    C:\Users\Peter\AppData\Roaming\**

The only path that still works is C:\Users\Peter\Standalone apps**.

By the way, I have this code recorded in the FilesCatalog package.

@DutchPete

This comment has been minimized.

Copy link
Author

DutchPete commented Sep 10, 2018

I have tried various things, like putting the activate line at the end, putting the paths = above each line, indenting, not indenting, but to no avail.

The only thing that works is

[profile/PortableApps] 
activate = yes 
paths = 
    C:\Users\Peter\Standalone apps\**

Any other suggestions?

@polyvertex

This comment has been minimized.

Copy link
Member

polyvertex commented Sep 10, 2018

The probability of FilesCatalog being bugged suddenly increased by an order of magnitude... :)

This has to be investigated but meanwhile, what you could try is to create one profile per path to scan (since it seems to be the issue according to your comments). Not very convenient admittedly but if it works:

[profile/Tools1]
activate = yes
paths = C:\Users\Peter\Standalone apps\**

[profile/Tools2]
activate = yes
paths = Q:\**

[profile/Tools3]
activate = yes
paths = C:\Users\Peter\AppData\Roaming\**

Again, do not hesitate to inherit from the ExeOnly profile and to limit max_depth in order to have a more efficient cataloging process and lower memory usage.

@DutchPete

This comment has been minimized.

Copy link
Author

DutchPete commented Sep 10, 2018

Jean-Charles, thanks once again. Unfortunately, this solution does not work either.
What do you mean by

The probability of FilesCatalog being bugged suddenly increased by an order of magnitude

Is that a bug on my side? Did I do something wrong?

@polyvertex

This comment has been minimized.

Copy link
Member

polyvertex commented Sep 10, 2018

I meant that, the config you provided here (i.e. the last one that has got a 3-lines paths value) seems syntactically correct so it is possible that you have found a bug in the FilesCatalog package. I did not do any test yet regarding this issue so far so it's just a guess.

[...] this solution does not work either.

What makes you say that?

@DutchPete

This comment has been minimized.

Copy link
Author

DutchPete commented Sep 10, 2018

What makes you say that?

When I type any of the folder or file names on the Q drive or in the AppData\Roaming folder, Kp does not list them. So the 3-path solution does not work.

Just to be absolutely clear from my side: I am not trying to make trouble because I like your program, despite the steep learning curve, and I do want to be able to use it ;-)

@polyvertex

This comment has been minimized.

Copy link
Member

polyvertex commented Sep 12, 2018

Bug confirmed. It will be fixed in next release, sorry for the inconvenience

@polyvertex

This comment has been minimized.

Copy link
Member

polyvertex commented Sep 12, 2018

Update on this, it seems to come specifically from the Q:\** value, in which case the following should work in the meantime:

[profile/PortableApps] 
activate = yes 
inherit = ExeOnly 
paths = 
    C:\Users\Peter\Standalone apps\** 
    C:\Users\Peter\AppData\Roaming\**
@DutchPete

This comment has been minimized.

Copy link
Author

DutchPete commented Sep 12, 2018

Thanks for confirming the bug - wow I am proud to have 'discovered' one.
Seriously, I am surprised that you say Q;\** is responsible. What's more, even with only the 2 lines you indicated, the Roaming one still does not work. Only the Standalone Apps works, as before.

FYI, I am using Launchy too, and all 3 lines work. So is Q:\** really responsible, or is it something else?
BTW, please don't tell me to get lost & stick with Launchy. I like Keypirinha because it has more features than Launchy. Is there a reason to not give Kp a GUI? It would make the program so much more accessible to a larger group of people.

@polyvertex

This comment has been minimized.

Copy link
Member

polyvertex commented Sep 12, 2018

I'm working on it, it was just a live update that is not a definitive explanation of the issue. I'll keep you posted!

Is there a reason to not give Kp a GUI? It would make the program so much more accessible to a larger group of people.

It probably would yes. It would also make of Keypirinha quite a different software. Having to modify the configuration in text files allows to provide some nice-to-have features from the scripting world. I.e. typically variable expansion and machine-specific configuration. There are also settings schemes, like "profiles", that are not always easy to transpose to a GUI (more work from the developer and less flexible to the user) and where a simple text file remains the fastest and easiest way for the user.

Obviously this is not a mainstream design choice and it suits best to advanced users but it's still a strong design choice made very early in KP's development process.

@DutchPete

This comment has been minimized.

Copy link
Author

DutchPete commented Sep 12, 2018

OK Jean-Charles, all that is clear. I'll await your update :-)

@polyvertex

This comment has been minimized.

Copy link
Member

polyvertex commented Sep 13, 2018

This should be fixed in v2.19, please check it out!

@polyvertex polyvertex closed this Sep 13, 2018

@DutchPete

This comment has been minimized.

Copy link
Author

DutchPete commented Sep 13, 2018

BINGO !!!!!
Mille remerciements Jean-Charles, it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.