View unanswered posts | View active topics It is currently Sat May 18, 2013 6:31 pm



Reply to topic  [ 77 posts ]  Go to page: Previous  1, 2, 3, 4, 5, 6  Next
 revised basic_mini views 
Author Message

Joined: Jan 14, 2007
Posts: 56
Post 
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?


Tue Oct 21, 2008 3:31 pm
Profile

Joined: Dec 11, 2007
Posts: 32
Post 
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.


Tue Oct 21, 2008 4:59 pm
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6642
Location: Austin, Texas
Post 
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)
Image


Tue Oct 21, 2008 5:22 pm
Profile WWW

Joined: Jan 14, 2007
Posts: 56
Post 
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


Tue Oct 21, 2008 6:17 pm
Profile

Joined: Dec 11, 2007
Posts: 32
Post 
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.



Tue Oct 21, 2008 6:27 pm
Profile
Site Admin
User avatar

Joined: Jan 27, 2003
Posts: 11679
Location: Texas
Post 
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


Tue Oct 21, 2008 6:28 pm
Profile WWW

Joined: Jan 14, 2007
Posts: 56
Post 
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!


Tue Oct 21, 2008 7:12 pm
Profile

Joined: Jan 14, 2007
Posts: 56
Post 
support wrote:I'm glad to see someone using the plug-in architecture!


Thank you for making it possible!


Tue Oct 21, 2008 7:18 pm
Profile

Joined: Dec 11, 2007
Posts: 32
Post 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.



Thu Oct 23, 2008 12:09 pm
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6642
Location: Austin, Texas
Post 
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)
Image


Thu Oct 23, 2008 1:13 pm
Profile WWW

Joined: Dec 11, 2007
Posts: 32
Post 
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?


Thu Oct 23, 2008 1:16 pm
Profile

Joined: Dec 11, 2007
Posts: 32
Post 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.



Thu Oct 23, 2008 3:58 pm
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6642
Location: Austin, Texas
Post 
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)
Image


Thu Oct 23, 2008 4:15 pm
Profile WWW

Joined: Jan 14, 2007
Posts: 56
Post 
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.


Mon Oct 27, 2008 12:45 pm
Profile

Joined: Sep 19, 2007
Posts: 61
Post 
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.


Mon Oct 27, 2008 6:06 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 77 posts ]  Go to page: Previous  1, 2, 3, 4, 5, 6  Next

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.   Template designed by STSoftware.