Welcome, Guest
Python Scripts for ComicRack

TOPIC: Priat(Path Reader and InterActive Tagger) V 0.0.9. Bugfix release

Priat(Path Reader and InterActive Tagger) V 0.0.9. Bugfix release 5 years 7 months ago #22115

  • tcm1998
  • tcm1998's Avatar
  • Offline
  • Expert Boarder
  • Posts: 94
  • Thank you received: 16
  • Karma: 6
<<< See changelog at the end of this post >>>

After working on this for nearly 2 weeks, the first beta version can finally be released. First and foremost, thanks have to go to:

Cyo - For writing this wonderful program in the first place. Without that there wouldn't be much need for any such plugins
Yellowbox - For writing the tagsfromname plugin, onwhich this is heavely based.
Neep - For putting his work in open source, so I could figure out how to create a plugin in c#, because my python knowledge is horrible.

I've been using CR for over a year now and the metadata in my library is practicaly non-existing. Mostly, because I don't want to put info about 35000 comics into the database manually. About a month ago, my eye fell on the tagsfromfilename plugin. I have considered to just using that plugin, but I wasn't looking forward to let a regex loose on my collection without any kind of preview. That's when the idea started to form in my head, creating a regex tagger with preview. Only last thursday (riding on my bicycle from work to home) I thought of the name. Priat, Pronounce "Pride" and stands for "Path Reader and InterActive Tagger. And that's exactly what it is.



Anyway, on the top of the screen is the regex input area. For convience the font can be resized and you can choose between proportional (Times New Roman) and non-propertional (Courier New). A regex can be saved by (optionally) putting a name in the name-box and pressing "Save". It will automaticaly be saved to file and added to the saved expressions list, fromwhere it can be loaded easily. The biggest part of the screen is made up by the list of filenames and paths.

As soon as you start typing, the regex is evaluated. If there are any capturegroups, they will appear as columns in the list. Groupnames that are recognised as supported will appear in blue and capitalisation will be adjusted. At every single keypress, the table is filled with the values from the regex. This way you can INSTANTLY see what the results are. What each part of the metadata is going to be filled with. Before each line in the list, there's a checkbox, so you can decide which comicbooks the expression is actually applied to. The bottom of the screen shows the "Apply" button and a little box where you can fill a tag in. If that tag is filled in, it's added to the "tags" field of the selected comicbooks. This way it's easy to create a smartlist in CR with the books that haven't been done yet. I placed a little messagebox after the processing is done, because there's no way to know otherwise if it's done. On my 2-year laptop, processing 35000 comics takes about 20 seconds.
Please wait until the messagebox pops up before closing the plugin.

Rightclicking on the books in the list, shows the context menu. For the moment there are only 3 options:

Select All (Just another entry to the same functionality)
Copy Path(s) (Copy all selected paths to the clipboard)
View details... (This shows the regex detail view, shown below)



This the grid in this window shows the captures of each group (named or unnamed). Depending on the selected cell, part of the path string is hilighted. If a group only has one capture, it doesn't matter which cell of that group is selected. If, however, a group gets multiple captures, the hilighted text depends on which capture is selected. If more than one path was selected in the main screen, the prev and next buttons allow to loop through the selected paths.
The details view still allows the regex to be modified. After that it can be saved in the saved expressions, copied into the clipboard or used in the main program.

I have to remind you all that this program is still in beta. It has ofcourse been tested on my own collection, but things can always go wrong. If you want to try it out, you might want to make a backup of your database first. I don't want to be responsible for loss of loads of data. Settings will be saved in the next version (choosen font, tagtext and columnwidths) and I'll probably put in a progressbar while applying, but I really wanted to bring this thing out in the open right now.

Changelog:
0.0.9 - Fixed crash with check/uncheck by spacebar
0.0.8 - Fixed the other index out of range crash (detail view)
0.0.7 - Fixed an index out of range crash
0.0.6 - Removed the test-regex being filled in at the start
- Fixed a crash when the clipboard is taken by anther program.
0.0.5 - Context menu and regex details screen
0.0.4 - Somewhat redesigned user interface
- Resizing now works properly (Requested)
- Sorting (see note *1) (Requested)
- Added Regex Manager which can ...
- Open regexes from file (Requested)
- Rename regexes
- Delete regexes (Requested)
0.0.3 - Should be compatible with any version of ComicRack
- Fixed a crash when scrolling to the end of the list, selecting more than one item and then
ticking one of them.

0.0.2 Fixed a crash due wrongly interpreted numbers
0.0.1 Initial Release

Note *1: As said in one of my posts. The data in the list is virtual. Data that the user hasn't seen yet has not been calculated yet. Therefore, sorting takes quite a bit of time when lots of comics are in the list. To avoid the program having to recalculate before sorting each time the regex is changed (which would lead to a long wait), behaviour is slightly odd. When the sorting column is set to the Path column, everything is normal and the list stays sorted (because the data in this column is not changed). However if the sorting column is set to one of the regex result columns, sorting is turned OFF each time the regex is changed. This behaviour is overridable with the checkbox at the bottom of the window.
Attachments:
Just madly collecting (dutch) comics
Last Edit: 5 years 3 months ago by tcm1998. Reason: New version release
The administrator has disabled public write access.
The following user(s) said Thank You: 600WPMPO, rmagere, misakitchi, Kirtai, wolverine68, Tom2112, ChrisR

Re: New Plugin "Priat" (successor of tags from name with regular expressions) 5 years 7 months ago #22116

  • perezmu
  • perezmu's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1114
  • Thank you received: 64
  • Karma: 51
This is a great start for your, hopefully, long career as a CR plugin writer. Welcome aboard, and thanks!
The administrator has disabled public write access.

Re: New Plugin "Priat" (successor of tags from name with regular expressions) 5 years 7 months ago #22120

  • cbanack
  • cbanack's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1327
  • Thank you received: 508
  • Karma: 182
Looks great! B)

You might even want to consider using Google Code or Sourceforge or something to host it, so people can always find the latest version really easily.
The administrator has disabled public write access.

Re: New Plugin "Priat" (successor of tags from name with regular expressions) 5 years 7 months ago #22121

  • perezmu
  • perezmu's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1114
  • Thank you received: 64
  • Karma: 51
Oooops, I am getting this error:

Warning: Spoiler! [ Click to expand ]
The administrator has disabled public write access.

Re: New Plugin "Priat" (successor of tags from name with regular expressions) 5 years 7 months ago #22124

  • 600WPMPO
  • 600WPMPO's Avatar
  • Offline
  • Moderator
  • Posts: 3788
  • Thank you received: 557
  • Karma: 232
+1 karma for the new script & an innovative name! :-)

I'll try it latest today & report back..
Now Playing: The ComicRack Manual (Online)

See my new comics & gadgets on: Tumblr!
The administrator has disabled public write access.

Re: New Plugin "Priat" (successor of tags from name with regular expressions) 5 years 7 months ago #22128

  • tcm1998
  • tcm1998's Avatar
  • Offline
  • Expert Boarder
  • Posts: 94
  • Thank you received: 16
  • Karma: 6
Thx for the karma, guys. It's greatly appreciated.

@cbanack: it will go into open source, but not before I properly commented it.

About the error...

The apply doesnt handle non-string values (like year, month, volume, etc) correctly. I will try to fix it today.
Just madly collecting (dutch) comics
Last Edit: 5 years 7 months ago by tcm1998.
The administrator has disabled public write access.

Re: New Plugin "Priat" (successor of tags from name with regular expressions) 5 years 7 months ago #22130

  • tcm1998
  • tcm1998's Avatar
  • Offline
  • Expert Boarder
  • Posts: 94
  • Thank you received: 16
  • Karma: 6
perezmu wrote:
Oooops, I am getting this error:

Fixed version available for download in the first post.

Fixed: Added support for numeric fields (including floating point).
Fixed: Removed BlackAndWhite, Manga and SeriesComplete from the supported list, because enumerations are not supported yet.
Fixed: Removed Tags from the supported list, because that field has special purpose.
Fixed: When applying, the fieldtype is checked and if the value isn't valid for that type, nothing will be applied for that type. E.g. is you try to fill in the year but a comic would be showing "A1990" under year, the year-field will be ignored for that book.
Added: When filling in the values in the list, the type is ALSO checked. If the value isn't valid, :Err: will appear in the list.
Fixed: When a column goes from recognised to unrecognised, the color is set back to black now.
Just madly collecting (dutch) comics
The administrator has disabled public write access.
The following user(s) said Thank You: 600WPMPO

Re: New Plugin "Priat" (successor of tags from name with regular expressions) 5 years 7 months ago #22132

  • perezmu
  • perezmu's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1114
  • Thank you received: 64
  • Karma: 51
It is working great!!!! So many thanks for this!!!!
The administrator has disabled public write access.

Re: New Plugin "Priat" (successor of tags from name with regular expressions) 5 years 7 months ago #22135

  • tcm1998
  • tcm1998's Avatar
  • Offline
  • Expert Boarder
  • Posts: 94
  • Thank you received: 16
  • Karma: 6
No problem. I hope it makes using regular expression easier for more people.
Just madly collecting (dutch) comics
The administrator has disabled public write access.

Re: New Plugin "Priat" (successor of tags from name with regular expressions) 5 years 7 months ago #22136

  • perezmu
  • perezmu's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1114
  • Thank you received: 64
  • Karma: 51
tcm1998 wrote:
No problem. I hope it makes using regular expression easier for more people.

Sure... but I have a couple of comments:blush: ... It seems it does not support the "Scan Information" field, right?. Also, I am experiencing this issue: if a load a previously saved regex, and I modify it in the edit box, changes are not applied in the live preview until the modification is saved. No hurry, though, it is pretty usable as it is.

Some further request (I know I am being annoying, being there, done that ;) ): possibility to remove saved regexps

Cheers! :laugh:

(Oh, boy, as of late I am asking so much from script writers, I could be 600 in disguise!!!!) :P :P :P
The administrator has disabled public write access.
Time to create page: 0.287 seconds

Who's Online

We have 208 guests and 5 members online