• 1
  • 87
  • 88
  • 89(current)
  • 90
  • 91
  • 146
Maraschino (formerly HTPC Frontend) - a summary web interface for your XBMC HTPC
hagur Wrote:Hi guys,

Just discovered this amazing thing and set it up, worked like a charm. I'm keen on developing my own modules, but I'm not sure how it's done.

Let's say my module is called mymodule.

This is what I've done so far:

- Added my new module to maraschino/modules.py
- Created mymodule.html in maraschino/templates
- Created mymodule.py in maraschino/modules
- Edited maraschino.py and added: "from modules.mymodule import *"

Now I can enter the config mode and select mymodule and add it to the page. Works fine. The mymodule.html template is rendered out, works fine.
When I edit mymodule.py I can see that the dev server detects the change, restarts and a mymodule.pyc file gets created, so my module is being picked up and compiled by python, apparently.

BUT ... It's not like any code in mymodule.py is actually being run. I can type whatever crap I like in there, and still get no error messages.

I'm also confused about the "entry point" in mymodule.py, does it need to have a constructor? Looking at some of the other modules, I see that there's a function with the same name as the module, so I typed that in, like so:

def xhr_mymodule():
print "ASDF"
return render_template('mymodule.html',
caption = "HELLO WORLD!"
)

but this never seems to run. Nothing gets printed out and the render_template method seems to do nothing.

In fact, I can remove mymodule.py completely and remove the "from modules.mymodule import *" line from maraschino.py file and my module still "works", that is, it gets rendered out. If I remove mymodule.html from the template folder then I finally get an exception from Flask, saying it cannot find a template called mymodule.html.

So I guess the real question is, what do I have to do to "link" mymodule.html to mymodule.py so I can call render_template and pass it some data?

Hope someone can help ... I've looked through most of the modules that ship with Maraschino and I cannot see what I'm doing wrong (or not doing).

Dude why are you hi-jacking this thread with unrelated issue. You should open a new thread in the developer area
Image

If my replies help you, please click on my reputation Image below :) thanks :)
Reply
payneardo Wrote:Is they any way of increasing the size of the mods (ie sickbeard) it only shows the next 2 TV shows and would it it to show then next say 5 with banners ?

I am using debian linux

Thanks for the great work Smile

edit: module-sickbeard.less in maraschino > static > less

look for:

Code:
#sb_content {
    max-height: [b]264[/b]px;

and change 264 to around 712
Reply
@hagur
Check out: http://flask.pocoo.org/docs/quickstart/. Mainly the rendering templates part.
Reply
saitoh183 Wrote:Dude why are you hi-jacking this thread with unrelated issue. You should open a new thread in the developer area

Unrelated issue? There are tons of posts on this thread about customizations and development for Maraschino.

What are we allowed to talk about here then?

All good though Wink
Reply
hagur Wrote:Unrelated issue? There are tons of posts on this thread about customizations and development for Maraschino.

What are we allowed to talk about here then?

All good though Wink

dude sorry about that...just realize my post didnt delete...i re-read your post and had decided to cancle it and it didnt delete ...
Image

If my replies help you, please click on my reputation Image below :) thanks :)
Reply
saitoh183 Wrote:dude sorry about that...just realize my post didnt delete...i re-read your post and had decided to cancle it and it didnt delete ...

No prob Smile
Reply
Thumbs Up 
m3g4tr0n Wrote:edit: module-sickbeard.less in maraschino > static > less

look for:

Code:
#sb_content {
    max-height: [b]264[/b]px;

and change 264 to around 712

Thank you so much that worked perfect, spot on

Cheers Smile
Reply
hagur Wrote:Hi guys,

Just discovered this amazing thing and set it up, worked like a charm. I'm keen on developing my own modules, but I'm not sure how it's done.

Blah, blah and a whole lot more of blah ...

Ok, I've figured this out now ... well kind of. If I set my module to be dynamic, then the mymodule.py gets executed and the render_template() method runs - but not initially on page load, but when it's requested via ajax.

I'm a bit confused now since the Applications module is static, but still executes everything in the modules/applications.py file.
Reply
@hagur,

If you could type up your findings and forward them to mrkipling, hopefully he may consider creating a 'how to' part at the MaraschinoProject to help others do what your trying to do.

I myself am also learning how all this stuff ties together. Currently learning Python basics using TheNewBoston's Video tutorials and using the Flask quickstart guide.
Image
Maraschino - Web based HTPC Organiser. Keep track of all your web based programs all in one place.
Home Page - Repo - Bug Tracker - Support Forum.
Reply
hagur, here is a hello world example of a bare bones module.

https://github.com/N3MIS15/maraschino/co...7fcd5fe467

might be helpful for anyone else who wants to give it a shot too.

Image
Reply
N3MIS15 Wrote:hagur, here is a hello world example of a bare bones module.

https://github.com/N3MIS15/maraschino/co...7fcd5fe467

might be helpful for anyone else who wants to give it a shot too.

Image

cool, thanks a lot, looking at replacing my igoogle page and looking at google search and another sabnzbd widget that shows the last 4 or 5 downloads (unless somebody has already done this Wink:p
Reply
N3MIS15 Wrote:hagur, here is a hello world example of a bare bones module.

https://github.com/N3MIS15/maraschino/co...7fcd5fe467

might be helpful for anyone else who wants to give it a shot too.

Image

Thanks for this info Smile

However, this is exactly what I had already done, but does not seem to work correctly unless the module is set as dynamic - which in my case is OK since the module I'm creating needs to be dynamic. It just bothers me that I do not fully understand how those static modules are supposed to work :o

Apart from that, all is good now and I have created one module so far (an iframe container module which allows you to embed other systems in an iframe on your Maraschino page) and I'm currently writing my second module, which is for the uTorrent Web API.

A quick Google search revealed that no uTorrent module seems to exist, but there's a ticket for it on the Maraschino page. If my module works well, I might submit it.
Reply
Im no expert so please correct me if i am wrong. I think that a static module is what it is, meaning once the page has loaded thats all you get unless it is manually told to re-render, wheras a dynamic module will keep updating the information based on polls.

You mentioned the applications module being static. that is true, the application module adds apps by adding them into the database and i assume it re-renders the template whenever an app is added
Reply
Just got it all to work Smile Very very nice I must admit, I had MFP installed, but this is so much smoother!

Some things to mention:
- Backgrounds / Thumbnails do NOT work with Chrome, I moved to FireFox and immediately I got a prompt for username / password for XBMC and now I see the backgrounds and thumpnails
- Transmission-Deamon seems to be not supported, I filled in all details, but the application is not visible from the main screen while I know there are torrents in there.

Question, will there be a CouchPotato API connectivity? Like you have for SickBeard?

Super cool, keep it going!!!!
Reply
Gomez Wrote:Found a solution to get Maraschino working under domain.com/maraschino:

Put this in your Apache Conf:
PHP Code:
Alias /static/ "/path/to/maraschino/static/"
ProxyPass /maraschino http://localhost:7000/
ProxyPassReverse /maraschino http://localhost:7000/
ProxyPass /xhr http://localhost:7000/xhr
ProxyPassReverse /xhr http://localhost:7000/xhr 

Hello,
I'm trying to get maraschino running with apache proxy and using the code above I've made some progress but it's still not working fully. When I use the code above what I get is the main maraschino page but there is no background, no styling and nothing works.

I can get to the background image by going to mydomain.com/maraschino/static/images/backgrounds/grass.jpg. what could the problem be?
Reply
  • 1
  • 87
  • 88
  • 89(current)
  • 90
  • 91
  • 146

Logout Mark Read Team Forum Stats Members Help
Maraschino (formerly HTPC Frontend) - a summary web interface for your XBMC HTPC4