Would it be possible to also launch templates in PharoLauncher?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Would it be possible to also launch templates in PharoLauncher?

Mariano Martinez Peck
Hi guys,

Thank you Christophe for continue pushing this useful tool!

One small request which might be easy to do... Quite frequently I want to do something and re-save an image I have previosuly saved as a custom template (under Local root tree). Right now what I have to do so:

1) Make a new image from that template
2) remove template
2) do the thing and save the opened image.
3) go back to laucher and save that image as a new template (with the same name of the one I deleted)
4) delete the created image

All that would be simplified if I could also launch my local templates. Is there any reason why is that not allowed? (at least for Local tree).

Thanks in advance, 

Reply | Threaded
Open this post in threaded view
|

Re: Would it be possible to also launch templates in PharoLauncher?

Mariano Martinez Peck


On Sun, Nov 26, 2017 at 11:08 PM, Mariano Martinez Peck <[hidden email]> wrote:
Hi guys,

Thank you Christophe for continue pushing this useful tool!

One small request which might be easy to do... Quite frequently I want to do something and re-save an image I have previosuly saved as a custom template (under Local root tree). Right now what I have to do so:

1) Make a new image from that template
2) remove template

Weird....I was needing to do this yet another time but now I cannot even find a way to remove a template (I was sure I could the other day...)

 
2) do the thing and save the opened image.
3) go back to laucher and save that image as a new template (with the same name of the one I deleted)
4) delete the created image

All that would be simplified if I could also launch my local templates. Is there any reason why is that not allowed? (at least for Local tree).

Thanks in advance, 




--
Reply | Threaded
Open this post in threaded view
|

Re: Would it be possible to also launch templates in PharoLauncher?

Ben Coman
In reply to this post by Mariano Martinez Peck
On 27 November 2017 at 10:08, Mariano Martinez Peck
<[hidden email]> wrote:

> Hi guys,
>
> Thank you Christophe for continue pushing this useful tool!
>
> One small request which might be easy to do... Quite frequently I want to do
> something and re-save an image I have previosuly saved as a custom template
> (under Local root tree). Right now what I have to do so:
>
> 1) Make a new image from that template
> 2) remove template
> 2) do the thing and save the opened image.
> 3) go back to laucher and save that image as a new template (with the same
> name of the one I deleted)
> 4) delete the created image
>
> All that would be simplified if I could also launch my local templates. Is
> there any reason why is that not allowed? (at least for Local tree).

Maybe you've discounted this already, but on the Image side you could
rename it "TemplateBlah"
then just use <Copy> to create new images from it.  Updating
"blahTemplate" is then already supported.

cheers -ben

Reply | Threaded
Open this post in threaded view
|

Re: Would it be possible to also launch templates in PharoLauncher?

demarey
In reply to this post by Mariano Martinez Peck
Hi Mariano,

> Le 27 nov. 2017 à 03:08, Mariano Martinez Peck <[hidden email]> a écrit :
>
> Hi guys,
>
> Thank you Christophe for continue pushing this useful tool!
>
> One small request which might be easy to do... Quite frequently I want to do something and re-save an image I have previosuly saved as a custom template (under Local root tree). Right now what I have to do so:
>
> 1) Make a new image from that template
> 2) remove template
> 2) do the thing and save the opened image.
> 3) go back to laucher and save that image as a new template (with the same name of the one I deleted)
> 4) delete the created image
>
> All that would be simplified if I could also launch my local templates. Is there any reason why is that not allowed? (at least for Local tree).

I needed to get a bit into the code to see what is done.
In PharoLauncher, when you download a template from the we, the template is stored in a folder (e.g. /Users/john/Library/Preferences/pharo/templateCache/) as well as some metadata for it.
PhLLocalTemplate class is used to build a list of locally available templates from the metadata file store in this folder.
As this folder is intended to be a cache, that’s why you cannot run it directly. You first need to unzip the template, create its metadata file.

Maybe an action on images: « create template from image and delete image » would help you (if it allows overriding of an existing template)?
You also have a « recreate » action on images able to recreate the image from the specified origin template.

Christophe
Reply | Threaded
Open this post in threaded view
|

Re: Would it be possible to also launch templates in PharoLauncher?

Mariano Martinez Peck


On Tue, Nov 28, 2017 at 2:05 PM, Christophe Demarey <[hidden email]> wrote:
Hi Mariano,

> Le 27 nov. 2017 à 03:08, Mariano Martinez Peck <[hidden email]> a écrit :
>
> Hi guys,
>
> Thank you Christophe for continue pushing this useful tool!
>
> One small request which might be easy to do... Quite frequently I want to do something and re-save an image I have previosuly saved as a custom template (under Local root tree). Right now what I have to do so:
>
> 1) Make a new image from that template
> 2) remove template
> 2) do the thing and save the opened image.
> 3) go back to laucher and save that image as a new template (with the same name of the one I deleted)
> 4) delete the created image
>
> All that would be simplified if I could also launch my local templates. Is there any reason why is that not allowed? (at least for Local tree).

I needed to get a bit into the code to see what is done.
In PharoLauncher, when you download a template from the we, the template is stored in a folder (e.g. /Users/john/Library/Preferences/pharo/templateCache/) as well as some metadata for it.
PhLLocalTemplate class is used to build a list of locally available templates from the metadata file store in this folder.
As this folder is intended to be a cache, that’s why you cannot run it directly. You first need to unzip the template, create its metadata file.

Maybe an action on images: « create template from image and delete image » would help you (if it allows overriding of an existing template)?

Yeah, that would work for me. So the only manual thing I would have to do is 1) right?  that is, I would need to first create an image from the template, do whatever I want with that image, and then  « create template from image and delete image »  which would save that image as template (override it if exists) and delete the created image. 
If I understood correct, yes, it would achieve what I want.


BTW, as a separate matter, even if you  the templates as a cache, I think it still would be nice to be able to delete a given one. 

 
You also have a « recreate » action on images able to recreate the image from the specified origin template.


OK


thanks in advance, 

--