It is currently Mon Jul 22, 2024 10:41 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 99 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject: Re: Test for duplicate scripts
PostPosted: Tue Nov 15, 2011 6:34 am  (#21) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
paynekj wrote:
At the moment I can't find an equivalent to DIR-SEPARATOR to give me a platform independent way for breaking up the path.

Windows is the only non-POSIX platform for which GIMP is available. It is therefore safe (at least for the present situation) to presume that if the DIR-SEPARATOR is POSIX-standard then the "path separator" would be also. I believe that the following code should be valid for all currently available GIMP deployments (this needs to be verified for Mac OS X but I'd expect it to work because even though its shell scripting uses colons for directory separators, the underlying system needs to be POSIX-compliant).
(define PATH-SEPARATOR (if (string=? DIR-SEPARATOR "\\") ";" ":")

(define (get-installed-directories)
  (strbreakup (car (gimp-gimprc-query "script-fu-path"))
              PATH-SEPARATOR ))

Note: a 'catch' wrapper is not needed since it is not possible for the rc-query to fail. If the 'script-fu-path' is not specified in gimprc, a default is provided (this is hard-coded into GIMP).

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Test for duplicate scripts
PostPosted: Tue Nov 15, 2011 6:44 am  (#22) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
saulgoode wrote:
paynekj wrote:
At the moment I can't find an equivalent to DIR-SEPARATOR to give me a platform independent way for breaking up the path.

Windows is the only non-POSIX platform for which GIMP is available. It is therefore safe (at least for the present situation) to presume that if the DIR-SEPARATOR is POSIX-standard then the "path separator" would be also. I believe that the following code should be valid for all currently available GIMP deployments (this needs to be verified for Mac OS X but I'd expect it to work because even though its shell scripting uses colons for directory separators, the underlying system needs to be POSIX-compliant).
(define PATH-SEPARATOR (if (string=? DIR-SEPARATOR "\\") ";" ":")

(define (get-installed-directories)
  (strbreakup (car (gimp-gimprc-query "script-fu-path"))
              PATH-SEPARATOR ))

Note: a 'catch' wrapper is not needed since it is not possible for the rc-query to fail. If the 'script-fu-path' is not specified in gimprc, a default is provided (this is hard-coded into GIMP).


Thanks. I've had the rc-query error when I've used it for my own entries so I was just playing safe. For the path-separator I've done exactly what you've shown (only not quite as neatly) However I am thinking that I will raise a Bugzilla request as I think that SEARCHPATH-SEPARATOR should be made available in script-fu.

Kevin

Update: I raised the bugzilla and less than 2 hours later my request got implemented. That's what I call good service :yes


Last edited by paynekj on Fri Nov 18, 2011 11:12 am, edited 1 time in total.

Top
 Post subject: Re: Test for duplicate scripts
PostPosted: Tue Nov 15, 2011 7:18 am  (#23) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
thanks Kevin

_________________
Image


Top
 Post subject: Re: Test for duplicate scripts
PostPosted: Tue Nov 15, 2011 8:38 am  (#24) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
My apologies, I've introduced another mistake, so here's version 1.4

Kevin

Update: We reached version 1.5, which is now on GimpScripts, see first post: viewtopic.php?f=9&t=3057&p=38900#p38900


Last edited by paynekj on Tue Nov 22, 2011 4:34 am, edited 1 time in total.

Top
 Post subject: Re: Test for duplicate scripts
PostPosted: Fri Nov 18, 2011 5:11 am  (#25) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
This should be the final version:
If no-one finds any problems in the next couple of days, I'll submit it to GimpScripts.

Things that haven't been checked:
That it runs on GIMP 2.7.n
That it runs on Macs

So unless someone checks these, I'll submit it and not claim that it works in those conditions (and make sure GnuTux notices this time ;) )

Kevin


Update: This is now on GimpScripts, see first post: viewtopic.php?f=9&t=3057&p=38900#p38900


Last edited by paynekj on Tue Nov 22, 2011 4:35 am, edited 2 times in total.

Top
 Post subject: Re: Test for duplicate scripts
PostPosted: Fri Nov 18, 2011 5:34 am  (#26) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
Kevin I tested it on Partha's 2.7.4 and it worked perfectly. ( no dupes)
Also checks out in Gimp-2.6.11 KUDO's

_________________
Image


Top
 Post subject: Re: Test for duplicate scripts
PostPosted: Tue Nov 22, 2011 4:37 am  (#27) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
As no-one complained about version 1.5, I've submitted it to GIMPScripts and updated the first post with the current operating instructions.

Thank you all for your help.

Kevin


Top
 Post subject: Re: Test for duplicate scripts
PostPosted: Tue Nov 22, 2011 4:55 am  (#28) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
Very nice job paynekj. works very well for me in both versions of Gimp. Kudos

_________________
Image


Top
 Post subject: Re: Test for duplicate scripts
PostPosted: Tue Nov 22, 2011 8:50 am  (#29) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14720
Location: USA
Very nice! :)
Thanks Kevin.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Test for duplicate scripts
PostPosted: Tue Nov 22, 2011 10:30 pm  (#30) 
Offline
GimpChat Member
User avatar

Joined: Apr 08, 2010
Posts: 5420
Location: Northwest Ohio
I tried to type (gimp-gimprc-query "script-fu-path") into the script-fu console on my mac but it won't let me type anything, it just beeps. Of course, I have no idea how the console works.


Top
 Post subject: Re: Test for duplicate scripts
PostPosted: Wed Nov 23, 2011 4:38 am  (#31) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there

It's just possible that you're typing in the wrong place as it's not obvious how to use it:
Image


Top
 Post subject: Re: Test for duplicate scripts
PostPosted: Wed Nov 23, 2011 6:41 pm  (#32) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Using these settings

Image

In 2.6.11 nothing returns

in 2.7.4-32bit I get this on my screen

Image

To say I don't understand this script would be an understatement

Maybe someone could fill me in on what version of gimp it is for, and on how to record the output

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Test for duplicate scripts
PostPosted: Wed Nov 23, 2011 7:06 pm  (#33) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
I get the same thing Graechan.
I think where it says found, one of them is your user\.gimp scripts and the other is your gimp\share\script files. looks like you have one dupe and the bottom one, (too many error messages) I don't know.

I also put beside logging > everything

_________________
Image


Top
 Post subject: Re: Test for duplicate scripts
PostPosted: Wed Nov 23, 2011 8:25 pm  (#34) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Molly in 2.7.4-port I found the file after setting the script to duplicates instead of none all OK there

in 2.6.11 I found the file after setting the script to duplicates instead of none, file was empty

I also tried setting to everything, same result

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Test for duplicate scripts
PostPosted: Thu Nov 24, 2011 2:27 am  (#35) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
Firstly to explain the "Too many messages":

You have GIMP set to direct errors and warnings to pop-up dialog boxes, and GIMP makes sure it doesn't give you too many, because that would be unfriendly. So it tries to accumulate them into a single pop-up, but if there's still too many, then it shows you that message and stops displaying any more.

To see all the warnings you need to have the error console open: Windows >> Dockable Dialogs >> Error Console, either as a window on it's own, or docked somewhere. Then all the errors and warnings get directed to the Error Console and not to pop-ups.

As for the duplicate, it's reporting that you have two scripts with the same procedure name (script-fu-drop-shadow) in two different files. This has the potential to cause problems and confusion.

Do you have a file named drop-shadow.scm in both C:\gimp-2.7.4-32\.gimp-2.7\scripts and C:\gimp-2.7.4-32\share\gimp\2.0\scripts ? And if you have two files, do the contents look the same?

If you want the script to save all the problems it finds into a separate file then select Logging: Duplicates and it will create a file in C:\gimp-2.7.4-32 called duplicate_scripts.txt

I'll have a go at installing so called 2.7.4 to try it myself and make sure that the installation doesn't duplicate the standard scripts as script-fu-drop-shadow is one that is shipped as standard with GIMP.

Kevin

Update:
I've installed so-called 2.7.4 (hate the dark theme) and it has installed the standard scripts into C:\gimp-2.7.4-32\share\gimp\2.0\scripts on your system. The other directory is something you have created, and possibly put the standard gimp scripts in there as well?


Top
 Post subject: Re: Test for duplicate scripts
PostPosted: Thu Nov 24, 2011 5:16 pm  (#36) 
Offline
GimpChat Member
User avatar

Joined: Apr 08, 2010
Posts: 5420
Location: Northwest Ohio
thanks paynekj, I will try the script fu console thing this weekend to do it the right way.


Top
 Post subject: Re: Test for duplicate scripts
PostPosted: Thu Nov 24, 2011 6:02 pm  (#37) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Does anyone have this script working in 2.6.11 :help

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Test for duplicate scripts
PostPosted: Thu Nov 24, 2011 8:08 pm  (#38) 
Offline
GimpChat Member

Joined: Mar 29, 2011
Posts: 346
Location: Wisconsin
Graechan wrote:
Does anyone have this script working in 2.6.11 :help

Worked fine for me, but it took quite a bit of time on my elderly machine.
- GIMP 2.6.11 on Windows XP
Image

_________________
Image


Top
 Post subject: Re: Test for duplicate scripts
PostPosted: Thu Nov 24, 2011 8:46 pm  (#39) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
When the script runs it takes a while then goes to a not responding state and shuts down after some time.
It leaves nothing on the screen then if I set it to duplicates only it does the same but also leaves a empty file called duplicate_scripts.txt in C:/users/graechan

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Test for duplicate scripts
PostPosted: Thu Nov 24, 2011 11:00 pm  (#40) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Eureka! I found my problem I had 817 scripts installed, I took out 108 and now OK 24 duplicates to sort through.

I would like to know what set the limit so that I can put my scripts back.I'm using win7 with 4gb ram

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
Post new topic Reply to topic  [ 99 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Juxtapose exactly duplicate paths

2

No new posts Attachment(s) GEGL Jelly - Apply on Duplicate Layer above and use eraser

3

No new posts Attachment(s) pm_create_a_depthmap_image.py (Test)

8

No new posts Jewelry Text Test

8



* Login  



Powered by phpBB3 © phpBB Group