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

Error: 'PathShellFilter' has no attribute 'name' #275

Closed
zmni opened this issue Jan 26, 2018 · 10 comments
Closed

Error: 'PathShellFilter' has no attribute 'name' #275

zmni opened this issue Jan 26, 2018 · 10 comments

Comments

@zmni
Copy link

@zmni zmni commented Jan 26, 2018

Everything scanned, it works just fine. But, what caused this error?

ERROR: Error from FilesCatalog.FilesCatalog.on_events: <class 'AttributeError'>: type object 'PathShellFilter' has no attribute 'name'
Traceback (most recent call last):
  File "E:\Keypirinha\default\Packages\FilesCatalog.keypirinha-package\filescatalog.py", line 355, in on_events
  File "E:\Keypirinha\default\Packages\FilesCatalog.keypirinha-package\filescatalog.py", line 660, in _read_config
  File "E:\Keypirinha\python\site\filefilter.py", line 106, in __eq__
    return hash(self) =
  • Is there something wrong with my FilesCatalog's config?
[profile/StartMenu]
activate = yes
paths = 
    ${var:KNOWNFOLDER_COMMONSTARTMENU}\**\*
    ${var:KNOWNFOLDER_STARTMENU}\**\*
max_depth = 1
filters =
    - Ketarin.lnk
    - VSCode.lnk
    - winbox.lnk
    + ext: .lnk .msc

[profile/PortableApps]
activate = yes
paths = ${var:APP_DRIVE}\*\*
max_depth = 0
filters =
    - *\Bin\*
    - Captura*.exe
    - Code.exe
    - LightBulb.exe
    - qbittorrent.exe
    - QOwnNotes.exe
    + ext: .exe .lnk
@polyvertex
Copy link
Member

@polyvertex polyvertex commented Jan 26, 2018

At first glance there does not seem to be something wrong with your config

@mrtvola
Copy link

@mrtvola mrtvola commented Jun 12, 2018

Hey. my Python knowledge is a bit rusty, but perhaps there should be self.__class__.__name__ instead of self.__class__.name in filefilter.py

@oskretc
Copy link

@oskretc oskretc commented Aug 2, 2018

Capital letters in Profile name seems to be the problem

@polyvertex
Copy link
Member

@polyvertex polyvertex commented Sep 13, 2018

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

@polyvertex polyvertex closed this Sep 13, 2018
@eugenesvk
Copy link

@eugenesvk eugenesvk commented Dec 8, 2019

Whenever I edit my FilesCatalog config file (e.g. add or remove a line in the paths variable), I have the same issue in version 2.24. Strangely enough, when I do Refresh Catalog...→FilesCatalog it seems to be working just fine, but when it auto-reloads on configuration changes (a very convenient feature to test/adjust paths/filters) this error pops up:

** ERROR: Error from FilesCatalog.FilesCatalog.on_events: <class 'AttributeError'>: type object 'PathShellFilter' has no attribute 'name'
Traceback (most recent call last):
  File "C:\App\1 Explore\Keypirinha\default\Packages\FilesCatalog.keypirinha-package\filescatalog.py", line 355, in on_events
  File "C:\App\1 Explore\Keypirinha\default\Packages\FilesCatalog.keypirinha-package\filescatalog.py", line 660, in _read_config
  File "C:\App\1 Explore\Keypirinha\python\site\filefilter.py", line 106, in __eq__
    return hash(self) == hash(other)
  File "C:\App\1 Explore\Keypirinha\python\site\filefilter.py", line 250, in __hash__
    self.hash_cache = hash((self.__class__.name,

With the following test filescatalog.ini configuration.

[profile/test]
activate	= yes
paths   	=
        	${var:KNOWNFOLDER_COMMONSTARTMENU}\Programs\2 Play\
        	${var:KNOWNFOLDER_COMMONSTARTMENU}\Programs\2 Play\iTunes\
        	${var:KNOWNFOLDER_PROGRAMS}\Programs\2 Play\
filters  =
         - *zz*

[profile/appsextra]
activate	= no
paths   	=
        	${var:KNOWNFOLDER_COMMONSTARTMENU}\Programs\
        	${var:KNOWNFOLDER_COMMONSTARTMENU}\
filters  =
         - *zz*
@Galliver7
Copy link

@Galliver7 Galliver7 commented Feb 25, 2020

Yeah, I have a same issue too @eugenesvk which is very waird.

[main]
debug = yes
[profile/DocumentedDefaults]
activate = yes
include_dirs = yes
paths =
    C:\Users\Galliver\Google ドライブ\**
    C:\Users\Galliver\*dev
    G:\共有ドライブ\**
filters =
    - *\firefox_profile\*
    ext: .pdf .gdoc .gsheet .gslides .txt .exe .docx .xlsx .pptx .doc .text
[profile/evernote]
activate = yes
paths =
    C:\Program Files (x86)\Evernote\Evernote\ENScript.exe
[profile/CdriveRoot]
activate = yes
include_dirs = yes
include_hidden = yes
max_depth = 0
paths =
    C:\**

then the console was show:

19:37:29.308 FilesCatalog.FilesCatalog: Activated profiles (3):
** Profile "CdriveRoot":
   internal_name   "cdriveroot"
   include_hidden  yes
   include_dirs    yes
   include_files   yes
   max_depth       0
   trim_extensions ('.lnk')
   file_item_label "{clean_name}"
   file_item_desc  <none>
   dir_item_label  "{clean_name}"
   dir_item_desc   <none>
   callback        default_scan_callback
   paths           C:\**
   filters         <none>

** Profile "DocumentedDefaults":
   internal_name   "documenteddefaults"
   include_hidden  no
   include_dirs    yes
   include_files   yes
   max_depth       -1
   trim_extensions ('.lnk')
   file_item_label "{clean_name}"
   file_item_desc  <none>
   dir_item_label  "{clean_name}"
   dir_item_desc   <none>
   callback        default_scan_callback
   paths           C:\Users\Galliver\Google ドライブ\**
                   C:\Users\Galliver\*dev
                   G:\共有ドライブ\**
   filters         - *\firefox_profile\*
                   + ext: .docx .pdf .pptx .gdoc .exe .doc .gsheet .gslides .xlsx .text .txt

** Profile "evernote":
   internal_name   "evernote"
   include_hidden  no
   include_dirs    no
   include_files   yes
   max_depth       -1
   trim_extensions ('.lnk')
   file_item_label "{clean_name}"
   file_item_desc  <none>
   dir_item_label  "{clean_name}"
   dir_item_desc   <none>
   callback        default_scan_callback
   paths           C:\Program Files (x86)\Evernote\Evernote\ENScript.exe
   filters         <none>
19:37:29.310 ** ERROR: Error from FilesCatalog.FilesCatalog.on_events: <class 'AttributeError'>: type object 'PathShellFilter' has no attribute 'name'
Traceback (most recent call last):
  File "C:\ProgramData\chocolatey\lib\keypirinha\tools\Keypirinha\default\Packages\FilesCatalog.keypirinha-package\filescatalog.py", line 355, in on_events
  File "C:\ProgramData\chocolatey\lib\keypirinha\tools\Keypirinha\default\Packages\FilesCatalog.keypirinha-package\filescatalog.py", line 660, in _read_config
  File "C:\ProgramData\chocolatey\lib\keypirinha\tools\Keypirinha\python\site\filefilter.py", line 106, in __eq__
    return hash(self) == hash(other)
  File "C:\ProgramData\chocolatey\lib\keypirinha\tools\Keypirinha\python\site\filefilter.py", line 250, in __hash__
    self.hash_cache = hash((self.__class__.name,

I used 2.24 and tried 2.23 since it has been changed something on 2.24, but isn't fixed too.

@polyvertex Do you have any idea that I made some mistake? or is it a bug?
I'd love your product so feel free to get me to run environmental test to figure out issue👍

@polyvertex
Copy link
Member

@polyvertex polyvertex commented Feb 25, 2020

So sorry for the inconvenience and for the lag. Definitely reopening this!
This will be fixed in next release

@polyvertex polyvertex reopened this Feb 25, 2020
@polyvertex
Copy link
Member

@polyvertex polyvertex commented Feb 25, 2020

FYI if you wish to check it out and confirm it is fixed, download a copy of the fixed filefilter.py file and move it to keypirinha\python\site\filefilter.py. Make a backup of the file you overwrite first!

Please report after that!

@eugenesvk
Copy link

@eugenesvk eugenesvk commented Feb 26, 2020

@polyvertex I've replaced the filefilter.py file and refreshed the FilesCatalog config after a couple of edits and didn't get any errors, so this seems to fix the issue

@polyvertex
Copy link
Member

@polyvertex polyvertex commented May 25, 2020

Should be fixed in v2.25.
Hopefully for real this time! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.