de en es fr
Let the machine help
Light teasing, exhibition, BDSM, sissyfication, watersports... with sounds and pictures


Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Suppress Image Not Found
PostPosted: Thu May 14, 2015 12:45 am 
Offline
Active member
Could we suppress file not found errors by default if the user is not an author? Instead just showing no image if the resources section failed to import the images?

I'm having terrible trouble trying to fill out the resources section in my scripts and as a result users are getting errors.

Can we also do a wildcard to say import all images in this folder rather than having to add each file to a new line in the resources?

Many thanks


Top
 Profile Send private message 
 
 Re: Suppress Image Not Found
PostPosted: Thu May 14, 2015 11:48 am 
Offline
Site Admin
User avatar
kb215 wrote:
Could we suppress file not found errors by default if the user is not an author? Instead just showing no image if the resources section failed to import the images?

I'm having terrible trouble trying to fill out the resources section in my scripts and as a result users are getting errors.


No, silent errors are worse, but...


kb215 wrote:
Can we also do a wildcard to say import all images in this folder rather than having to add each file to a new line in the resources?

Many thanks


...it already works - see here.


Top
 Profile Send private message 
 
 Re: Suppress Image Not Found
PostPosted: Thu May 14, 2015 1:39 pm 
Offline
Veteran
User avatar
kb215 wrote:
Could we suppress file not found errors by default if the user is not an author? Instead just showing no image if the resources section failed to import the images?


You could have a wrapper function such as:

Code:
def ShowImage = { img_name ->
  if (new File("images/"+img_name).exists())
    setImage(img_name)
  else
    setImage(null)
}


Then just use ShowImage("image.jpg") instead of setImage and it will just not display an image if it does not exist.

Sorry Doti if this is not good practice :roll:

_________________
Liz

You can't take something off the Internet - it's like taking pee out of a pool.
PlayClan.com profile: Liz


Top
 Profile Send private message 
 
 Re: Suppress Image Not Found
PostPosted: Mon May 18, 2015 4:43 am 
Offline
Active member
Excellent thank you for the help. I hate to leave users with errors.

I have now in the main file of campdrain:
Code:
/*
* Resources
* scripts/campdrain.groovy
* scripts/campdrain/Functions.groovy
* scripts/campdrain/drainers.groovy
* scripts/campdrain/day7.groovy
* scripts/campdrain/day6.groovy
* scripts/campdrain/day5.groovy
* scripts/campdrain/day4.groovy
* scripts/campdrain/day2.groovy
* scripts/campdrain/day1.groovy
* images/campdrain/*
* images/milovana/12017/*
* images/milovana/17645/*
* images/milovana/17661/*
* images/milovana/17662/*
* images/milovana/17664/*
* images/milovana/17687/*
*/


Does this look right?


Top
 Profile Send private message 
 
 Re: Suppress Image Not Found
PostPosted: Mon May 18, 2015 7:24 pm 
Offline
Site Admin
User avatar
YOu can even do :
Code:
/*
* Resources
* scripts/campdrain.groovy
* scripts/campdrain/*
* images/campdrain/*
* images/milovana/12017/*
* images/milovana/17645/*
* images/milovana/17661/*
* images/milovana/17662/*
* images/milovana/17664/*
* images/milovana/17687/*
*/


Top
 Profile Send private message 
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Maroon Fusion theme created by Oxydo
Software, theme modifications, phpBB modification by Doti 2010, 2015
This website uses session cookies only.