revised basic_mini views

Posted on
Tue Oct 21, 2008 3:31 pm
jashaffner offline
Posts: 59
Joined: Jan 14, 2007

(No subject)

That works. Was hoping that the path could be relative to either the plugin or the calling template. Thanks.

I tried using /turnon (turnoff, etc) for the url but then it would redirect to basicpage instead of the plugin. Does it mean that I would have to duplicate the code perhaps from indigoreqhandler.py into functions in plugin's reqhandler.py?

Posted on
Tue Oct 21, 2008 4:59 pm
seaofclouds offline
Posts: 32
Joined: Dec 11, 2007

(No subject)

AWESOME!

I was about to take the plunge when I saw your posting here. So that I can continue to contribute, and easily, can you please keep your code on github? I can then pull any changes back in.

Cheers!

jashaffner wrote:
Lets say that I have two templates in my plugin. What path can I use in templateA to include templateB? I tried a couple different paths but to no luck.

Thanks.

ps: i am attempting to port seaofcloud's work into a plugin just to learn how to make use of plugin architecture thus the reason for my posts within this thread.

Posted on
Tue Oct 21, 2008 5:22 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

(No subject)

jashaffner wrote:
tried using /turnon (turnoff, etc) for the url but then it would redirect to basicpage instead of the plugin. Does it mean that I would have to duplicate the code perhaps from indigoreqhandler.py into functions in plugin's reqhandler.py?


I may not be following you, but if turnon is the name of your plugin, then you'd implement your functionality inside the
Code: Select all
def index(self):


handler. If you wanted multiple functions, then you'd implement them in separate handlers. So, for instance, you could name your plugin "coolplugin" and define two handlers, "turnon" and "turnoff", then call them with:

/coolplugin/turnon

and

/coolplugin/turnoff

Does that answer your question?

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Oct 21, 2008 6:17 pm
jashaffner offline
Posts: 59
Joined: Jan 14, 2007

(No subject)

When using basicpage, it contains links starting with /turnon, /turnoff, /setbrightness and they would redirect you back to basicpage.

I see that /basicpage is hardcoded in IWS/templates/reload.html. I was hoping that I could pass the "return_to_this_page" parameter. The more I think about it, the more it makes sense to try and make plugin as independent from the core as possible. In that case, I went ahead and duplicate some of the code before cleaning it up a bit.

seaofclouds, the plugin is yours to wrap it up and "certify" once someone tells me how to attach a zip file here. :)

cheers,
j

Posted on
Tue Oct 21, 2008 6:27 pm
seaofclouds offline
Posts: 32
Joined: Dec 11, 2007

(No subject)

not sure about uploading here, but you can always upload your zip file to a free service like: http://dropsend.com then share the link here, or through github where the code will likely stay hosted and maintained.

This rocks, by the way. can't wait to lighten up the README and how-to. Thanks again for all your hard work. :)

jashaffner wrote:
seaofclouds, the plugin is yours to wrap it up and "certify" once someone tells me how to attach a zip file here. :)
Last edited by seaofclouds on Tue Oct 21, 2008 6:41 pm, edited 1 time in total.

Posted on
Tue Oct 21, 2008 6:28 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

(No subject)

jashaffner wrote:
I see that /basicpage is hardcoded in IWS/templates/reload.html. I was hoping that I could pass the "return_to_this_page" parameter. The more I think about it, the more it makes sense to try and make plugin as independent from the core as possible. In that case, I went ahead and duplicate some of the code before cleaning it up a bit.

Yeah, in this case, where you want to have a URL that can turn devices on/off and then reload your page, duplicating the functionality is the best approach.

I'm glad to see someone using the plug-in architecture!

Regards,
Matt

Posted on
Tue Oct 21, 2008 7:12 pm
jashaffner offline
Posts: 59
Joined: Jan 14, 2007

(No subject)

seaofclouds wrote:
not sure about uploading here, but you can always upload your zip file to a free service like: http://dropsend.com then share the link here, or through github where the code will likely stay hosted and maintained.


http://myaccount.dropsend.com/file/ea679bd4cc67ac79

seaofclouds, you may want to add back action groups and variables sections and remove unnecessary files from css and/or images if any. Thank you!

Posted on
Tue Oct 21, 2008 7:18 pm
jashaffner offline
Posts: 59
Joined: Jan 14, 2007

(No subject)

support wrote:
I'm glad to see someone using the plug-in architecture!


Thank you for making it possible!

Posted on
Thu Oct 23, 2008 12:09 pm
seaofclouds offline
Posts: 32
Joined: Dec 11, 2007

use these mini_views as a desktop app

i just updated these mini_views and readme with instructions for creating a desktop app, using fluid:

Image

have a look at:

http://github.com/seaofclouds/indigo-web/tree/master


SIDENOTE: i've got the beginnings of the plugin on github, and a good start at making these contributions more visible and accessible in plugin form. thanks!

http://github.com/seaofclouds/indigo-mini-view-plugin/
Last edited by seaofclouds on Thu Oct 23, 2008 4:13 pm, edited 1 time in total.

Posted on
Thu Oct 23, 2008 1:13 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

(No subject)

Excellent! Once you get them done, please add them to the User Contribution Library so they'll be easy to find! Thanks!

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Oct 23, 2008 1:16 pm
seaofclouds offline
Posts: 32
Joined: Dec 11, 2007

(No subject)

jashaffner wrote:
seaofclouds, you may want to add back action groups and variables sections and remove unnecessary files from css and/or images if any. Thank you!


@jashaffner, thanks for uploading. i definitely want to add action groups in, but have absolutely no idea how to do that. i can add an include, and style it, but when it comes to adding variables and such to the .py file, i'm completely lost. got a pointer? can i copy that code from elsewhere?

Posted on
Thu Oct 23, 2008 3:58 pm
seaofclouds offline
Posts: 32
Joined: Dec 11, 2007

converted to a plugin, thanks jashaffner!

you can get these mini views in plugin form from the file lib, and at:

http://github.com/seaofclouds/indigo-mini-view-plugin/

currently, only on/off and brightness are supported in plugin form. i'm not as much of a python programmer as i am a designer, and i'm not sure how to get actions to display. please contribute, if you can.
Last edited by seaofclouds on Thu Oct 23, 2008 4:23 pm, edited 1 time in total.

Posted on
Thu Oct 23, 2008 4:15 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

(No subject)

Great, thanks. I added a note to your post in the file library about requiring 3.0.6. While the plug-in architecture has been around since 3.0, we had to make some non-backwards compatible changes in 3.0.6 when we moved to the next version of cherrypy, so any plugins will now require 3.0.6. (Fortunately I was the only one that had built any so it wasn't a huge deal to upgrade).

Thanks again!

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Oct 27, 2008 12:45 pm
jashaffner offline
Posts: 59
Joined: Jan 14, 2007

(No subject)

Sorry for late reply. I either did not get notifications or totally missed the notifications.

If you have not added back the actions/variables sections, I can go in and add them back. I was in a hurry the other night and did not want you to wait too long for me.

Posted on
Mon Oct 27, 2008 6:06 pm
thepainter offline
Posts: 65
Joined: Sep 19, 2007

(No subject)

Just want to say 'Thanks' it looks GREAT and works really well with my 'Touch'. Thanks again for all the hard work to everyone involved.

Who is online

Users browsing this forum: No registered users and 12 guests