Welcome, Guest
Python Scripts for ComicRack

TOPIC: Organize Library Files & Folders 2.0

Re:Organize Library Files & Folders 2.0 8 years 2 months ago #4030

  • pcvii
  • pcvii's Avatar
  • Offline
  • Expert Boarder
  • Posts: 80
  • Thank you received: 1
  • Karma: 0
I also posted about another error before your last post. I think it's related to a comic missing data.

I didn't want you to not notice.

I posted the xml and the debug data so you could see exactly how much data there was. and where it errored.
The administrator has disabled public write access.

Re:Organize Library Files & Folders 2.0 8 years 2 months ago #4031

  • pcvii
  • pcvii's Avatar
  • Offline
  • Expert Boarder
  • Posts: 80
  • Thank you received: 1
  • Karma: 0
currentdirectory = AppDomain.CurrentDomain.BaseDirectory + 'Scripts'

maybe something like the above will work better than
currentdirectory = Directory.GetCurrentDirectory()

I'm going to try it. it might just do the same thing. I saw it in another script.
The administrator has disabled public write access.

Re:Organize Library Files & Folders 2.0 8 years 2 months ago #4032

  • oraclexview
  • oraclexview's Avatar
  • Offline
  • Moderator
  • aka SoundWave
  • Posts: 906
  • Thank you received: 182
  • Karma: 37
Now , as far as your 2nd set of code that you provided, I see that my script was at one point looking for an integer but instead got some kind of set of data. I looked over the code and I don’t directly see what would cause this message “expected int, got getset_descriptor”. I must admit, I didn't test for a negative number value in the book.Number object, so at this point I'm assuming that this is the potential cause of the problem even though this doesn’t seem to be the case after looking through the script code. I’ll create some generic test files with negative issue values in the book.Number object and see if I get the same exception message as you did.

Onyx X aka SoundWave
The administrator has disabled public write access.

Re:Organize Library Files & Folders 2.0 8 years 2 months ago #4033

  • pcvii
  • pcvii's Avatar
  • Offline
  • Expert Boarder
  • Posts: 80
  • Thank you received: 1
  • Karma: 0
Yep that worked! Instead of just being what ever working directory you happen to be in the script looked in the
appsfolder\\scripts

I should be able to set my working directory to
Z:\\blah
and as long as comicrack can still find the py file it should still run. now I'm going to fix that other script that was causing the directory change so I won't run into that error again on another script.

Yea just to make sure I ran the copy of the script that I didn't edit the one. The Test one. And that one still gave the error. Because of the working directory not being right.
Last Edit: 8 years 2 months ago by pcvii.
The administrator has disabled public write access.

Re:Organize Library Files & Folders 2.0 8 years 2 months ago #4034

  • pcvii
  • pcvii's Avatar
  • Offline
  • Expert Boarder
  • Posts: 80
  • Thank you received: 1
  • Karma: 0
I received the same error when it wasn't a negative number.

Usually when comic's number field doesn't have just a number your script treats it as a string.
I noticed
Fathom 1/2
didn't cause an error. it just printed
Fathom #1 2
because slashes can't be in file names. But it worked you know.
The administrator has disabled public write access.

Re:Organize Library Files & Folders 2.0 8 years 2 months ago #4035

  • pcvii
  • pcvii's Avatar
  • Offline
  • Expert Boarder
  • Posts: 80
  • Thank you received: 1
  • Karma: 0
I was thinking it might be something you changed from 2.1 to 2.1.1 My old copy that i manually fixed did work at one point on this file.

And thanks to you for showing me how to debug i was able to fix 'StartTagsFromName' so it didn't cause more problems in the future :D

It was changing the working directory when it opened a dialog box to load saved settings. So I made it set the working directory back after you loaded or saved the settings. But changing
currentdirectory = Directory.GetCurrentDirectory()
to
currentdirectory = AppDomain.CurrentDomain.BaseDirectory + 'Scripts'

did cause the error to no longer happen for me with out fixing 'StartTagsFromName'
The administrator has disabled public write access.

Re:Organize Library Files & Folders 2.0 8 years 2 months ago #4037

  • oraclexview
  • oraclexview's Avatar
  • Offline
  • Moderator
  • aka SoundWave
  • Posts: 906
  • Thank you received: 182
  • Karma: 37
pcvii wrote:
Calling 'StartTagsFromName'...

Compilation of 'TagsFromName.py'

Syntax error at [0, 0]: Could not find file 'C:\\Program Files\\ComicRack\\Scripts\\TagPatterns\\TagsFromName.py'.

	in file 'TagsFromName.py'

Calling 'OrganizeLibraryFilesFolders21Test'...

Current directory is  C:\\Program Files\\ComicRack\\Scripts\\TagPatterns

Configuration text file directory is  C:\\Program Files\\ComicRack\\Scripts\\TagPatterns\\OrganizeLibraryFilesFolders21

Configuration Library Root Directory text file name is  ConfigLibraryRootDirectory.txt

Full path of configuaration text file is  C:\\Program Files\\ComicRack\\Scripts\\TagPatterns\\OrganizeLibraryFilesFolders21\\ConfigLibraryRootDirectory.txt

ConfigLibraryRootDirectory.txt  does not exist! DARN

Could not find a part of the path 'C:\\Program Files\\ComicRack\\Scripts\\TagPatterns\\OrganizeLibraryFilesFolders21\\ConfigLibraryRootDirectory.txt'.

here's the error I was having when i would run some scripts then the others break because it changes the working directory.
It seems that if you use the FileDialog.InitialDirectory property, as the script 'TagsFromName.py' does, then you also need to use the FileDialog.RestoreDirectory property to restore the current directory to its original state before the dialog closes. Otherwise, it would appear that the initial directory which was set become the permanent current/working directory. This at least is my theory after researching the MSDN library, but I have yet to fully test this out.

pcvii wrote:
currentdirectory = AppDomain.CurrentDomain.BaseDirectory + 'Scripts'

maybe something like the above will work better than
currentdirectory = Directory.GetCurrentDirectory()

I'm going to try it. it might just do the same thing. I saw it in another script.
Also, as you’ve pointed out, using the AppDomain.CurrentDomain.BaseDirectory property would seemingly allow the script to more efficiently handle and bypass the potential exception error created above rather than using the Directory.GetCurrentDirectory method. So I’ll be testing this out and adding it to the next updated version of the script.
I’m still trying to reproduce the error you got that gave you the exception note “expected int, got getset_descriptor”. I’ll keep you updated and thanks for the great feedback. I’m learning a lot as well.

Onyx X aka SoundWave
The administrator has disabled public write access.

Re:Organize Library Files & Folders 2.0 8 years 2 months ago #4041

  • pcvii
  • pcvii's Avatar
  • Offline
  • Expert Boarder
  • Posts: 80
  • Thank you received: 1
  • Karma: 0
Oh you can attach files. I thought I would need to steal some web space. Right now I'm using my old version of this script that I had manually fixed the errors. You posted your fixes for this. I just kept using mine. Till, I had that issue with the working directory thing. Then I downloaded yours. Which still had that problem. And this new error about the not-int thing. I'll zip up a couple comics that gave the error and the current custom edited script. And your script when I was using it I had the not-int error.
My current custom fixed version of 2.1 doesn't have the not-int error. I think it's because we fixed it differently.

I'll label the script that gave the error with .new extension.
I'm attaching it because maybe I'm not using the same script version you are and I just thought I downloaded the new one. Better safe than sorry. I mean it does say 2.1.1 in the comments at the top.
And mine has custom in the file name.
Maybe you'll see something when you compare the two files.

I just used the script on one of the files i put in this zip to make sure it still was giving the error. :P

huh the file didn't seem to upload i guess I'll have to put less comics in it.
Attachments:
Last Edit: 8 years 2 months ago by pcvii.
The administrator has disabled public write access.

Re:Organize Library Files & Folders 2.0 8 years 2 months ago #4042

  • pcvii
  • pcvii's Avatar
  • Offline
  • Expert Boarder
  • Posts: 80
  • Thank you received: 1
  • Karma: 0
well i think it was either too big or the filename had spaces and it didn't like it so i removed the spaces and removed comics to make it smaller.
The administrator has disabled public write access.

Re:Organize Library Files & Folders 2.0 8 years 2 months ago #4043

  • pcvii
  • pcvii's Avatar
  • Offline
  • Expert Boarder
  • Posts: 80
  • Thank you received: 1
  • Karma: 0
i guess it needs to be less than 120kb. i can't upload the comics. each of them are atleast 2 mbs.

i'll upload my custom copy of the script. and if you still want the comics i guess i could email them or if you want send a copy with out the images in it. i donno if that'll do you good.

File Attachment:

File Name: OrganizeLi...anga.zip
File Size:23 KB
The administrator has disabled public write access.
Time to create page: 0.378 seconds

Who's Online

We have 154 guests and 6 members online