Kodi Community Forum
Maraschino (formerly HTPC Frontend) - a summary web interface for your XBMC HTPC - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116)
+--- Thread: Maraschino (formerly HTPC Frontend) - a summary web interface for your XBMC HTPC (/showthread.php?tid=113136)



- mrkipling - 2011-11-07

Okay, I've just pushed some pretty hefty changes to the master branch. It's the in-app-config stuff that I mentioned previously.

If you're already using Maraschino and wish to use this new version then it's going to require a few changes, and you're going to lose any customisation that you've already entered. Bigger picture though - it'll be worth it Smile

I've updated maraschinoproject.com with new instructions, but I've written some instructions (below) for people who are upgrading from the old version.

First, do a "git pull" to update your copy of the repository.

Next, install the new dependency - "easy_install Flask-SQLAlchemy"

Now delete your settings.py file. That's right, delete it!

Copy the new settings_example.py over to settings.py and open it in your editor. You'll notice that there is now only one setting: DATABASE. Make it point to where you would like the database file saved, e.g.:

Code:
DATABASE = '/var/www/maraschino/maraschino.db'

Make sure that the web server has write access to this directory.

Now, run the setup file (this example assumes that you're in the Maraschino directory):

Code:
python setup.py

If you see "Database successfully initialised" then you're good to go. If you get an error then running this command as a superuser (e.g. "sudo python setup.py") might help.

htpcfrontend.py has been renamed to maraschino.py, so you're going to need to update your WSGI file to look something like this:

Code:
import sys
sys.path.insert(0, "/var/www/maraschino")
from maraschino import app as application

If you're using Apache, make sure that www-data is the owner of the directory/files:

Code:
cd /var/www
sudo chown www-data:www-data maraschino -R

Finally, restart Apache and open Maraschino in your browser.

If things looks weird then clear your browser's cache and reload the page as the CSS has changed quite a bit.

It should be fairly self-explanatory how to add, remove, configure and organise modules, but I'm here if you have any questions.

Also, there may be bugs. They're an inevitable part of an early-stage project like this. Please let me know if you find any and I'll do what I can to fix them!


- DejaVu - 2011-11-07

Initialising the Database -
Code:
xbmc@XBMCLive:/var/www/maraschino$ sudo easy_install Flask-SQLAlchemy
Searching for Flask-SQLAlchemy
Best match: Flask-SQLAlchemy 0.15
Processing Flask_SQLAlchemy-0.15-py2.6.egg
Flask-SQLAlchemy 0.15 is already the active version in easy-install.pth

Using /usr/local/lib/python2.6/dist-packages/Flask_SQLAlchemy-0.15-py2.6.egg
Processing dependencies for Flask-SQLAlchemy
Finished processing dependencies for Flask-SQLAlchemy
xbmc@XBMCLive:/var/www/maraschino$ cd /var/www/maraschino
xbmc@XBMCLive:/var/www/maraschino$ python setup.py
Traceback (most recent call last):
  File "setup.py", line 8, in <module>
    init_db()
  File "/var/www/maraschino/database.py", line 16, in init_db
    Base.metadata.create_all(bind=engine)
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/schema.py", line 2434, in create_all
    tables=tables)
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/engine/base.py", line 2224, in _run_visitor
    conn = self.contextual_connect(close_with_result=False)
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/engine/base.py", line 2334, in contextual_connect
    self.pool.connect(),
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/pool.py", line 210, in connect
    return _ConnectionFairy(self).checkout()
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/pool.py", line 371, in __init__
    rec = self._connection_record = pool._do_get()
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/pool.py", line 758, in _do_get
    return self._create_connection()
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/pool.py", line 174, in _create_connection
    return _ConnectionRecord(self)
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/pool.py", line 256, in __init__
    self.connection = self.__connect()
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/pool.py", line 316, in __connect
    connection = self.__pool._creator()
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/engine/strategies.py", line 80, in connect
    return dialect.connect(*cargs, **cparams)
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/engine/default.py", line 280, in connect
    return self.dbapi.connect(*cargs, **cparams)
sqlalchemy.exc.OperationalError: (OperationalError) unable to open database file None None
xbmc@XBMCLive:/var/www/maraschino$



- mrkipling - 2011-11-07

DejaVu Wrote:Initialising the Database -
Code:
xbmc@XBMCLive:/var/www/maraschino$ sudo easy_install Flask-SQLAlchemy
Searching for Flask-SQLAlchemy
Best match: Flask-SQLAlchemy 0.15
Processing Flask_SQLAlchemy-0.15-py2.6.egg
Flask-SQLAlchemy 0.15 is already the active version in easy-install.pth

Using /usr/local/lib/python2.6/dist-packages/Flask_SQLAlchemy-0.15-py2.6.egg
Processing dependencies for Flask-SQLAlchemy
Finished processing dependencies for Flask-SQLAlchemy
xbmc@XBMCLive:/var/www/maraschino$ cd /var/www/maraschino
xbmc@XBMCLive:/var/www/maraschino$ python setup.py
Traceback (most recent call last):
  File "setup.py", line 8, in <module>
    init_db()
  File "/var/www/maraschino/database.py", line 16, in init_db
    Base.metadata.create_all(bind=engine)
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/schema.py", line 2434, in create_all
    tables=tables)
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/engine/base.py", line 2224, in _run_visitor
    conn = self.contextual_connect(close_with_result=False)
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/engine/base.py", line 2334, in contextual_connect
    self.pool.connect(),
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/pool.py", line 210, in connect
    return _ConnectionFairy(self).checkout()
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/pool.py", line 371, in __init__
    rec = self._connection_record = pool._do_get()
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/pool.py", line 758, in _do_get
    return self._create_connection()
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/pool.py", line 174, in _create_connection
    return _ConnectionRecord(self)
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/pool.py", line 256, in __init__
    self.connection = self.__connect()
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/pool.py", line 316, in __connect
    connection = self.__pool._creator()
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/engine/strategies.py", line 80, in connect
    return dialect.connect(*cargs, **cparams)
  File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.3-py2.6.egg/sqlalchemy/engine/default.py", line 280, in connect
    return self.dbapi.connect(*cargs, **cparams)
sqlalchemy.exc.OperationalError: (OperationalError) unable to open database file None None
xbmc@XBMCLive:/var/www/maraschino$

Looks like you don't have write access to the database file. Try running the command as superuser ("sudo python setup.py").

Edit: I added another step to the instructions above (better safe than sorry): if you're using Apache, make sure that www-data is the owner of the directory/files:

Code:
cd /var/www
sudo chown www-data:www-data maraschino -R



- DejaVu - 2011-11-07

Forget this - Totally my thought. Typo in Settings.py! Big Grin


- DejaVu - 2011-11-07

This project went from great to OMFG THIS IS SO F&%KING AWSEOME!!

MrK, my hat is off to you, with percula's config infos and you at the helm, this thing is going to be immense. The settings thing you knocked up in just a few days is impressive!!


- mrkipling - 2011-11-07

DejaVu Wrote:This project went from great to OMFG THIS IS SO F&%KING AWSEOME!!

MrK, my hat is off to you, with percula's config infos and you at the helm, this thing is going to be immense. The settings thing you knocked up in just a few days is impressive!!

Glad you like it! I wasn't too crazy about adding another dependency but I think that the ability to configure stuff from within the app is worth it in the long run Smile


- HarryRosen - 2011-11-07

I still can't get the wsgi file part to work so still using your method dejavu, but so much nicer with the modules. Time to start getting new ones, if you guys can point me in the right direction I can give writing a couple of modules a shot,never tried writing code before. would love a recently added movies and maybe add a couple more options to the now playing and maybe an update library for music and videos. Also don't know if its possible to control more that 1 xbmc, would love one interface to control them all Smile


- DejaVu - 2011-11-07

I got it working using percula's instructions for installing to Ubuntu. It's all there, just make sure the WSGI file is updated with the the new maraschino file name. (htpcfrontend.py is now maraschino.py).


- Zenshi - 2011-11-07

How do we get the images to show?

I tried using
Code:
/static/images/programs/XBMC.png
or
Code:
/var/www/maraschino/static/images/programs/XBMC.png
and none of them works.

Also, would it be possible in the near future to use this in a location rather then the root, as I asked a few posts before?


Keep up the good work MrK,

Zenshi.


- mrkipling - 2011-11-07

Zenshi Wrote:How do we get the images to show?

I tried using
Code:
/static/images/programs/XBMC.png
or
Code:
/var/www/maraschino/static/images/programs/XBMC.png
and none of them works.

Also, would it be possible in the near future to use this in a location rather then the root, as I asked a few posts before?


Keep up the good work MrK,

Zenshi.

I've hard-coded the images directory to be "/static/images/applications", so you just need to enter "XBMC.png". If you want to add any more icons then just drop them in that folder. Sorry, I didn't really document this.

DejaVu has added a whole bunch of new icons (and a snazzy favicon) - I'll merge these into the main branch real soon.


- Zenshi - 2011-11-07

mrkipling Wrote:I've hard-coded the images directory to be "/static/images/applications", so you just need to enter "XBMC.png". If you want to add any more icons then just drop them in that folder. Sorry, I didn't really document this.

DejaVu has added a whole bunch of new icons (and a snazzy favicon) - I'll merge these into the main branch real soon.

No problem, just remember to add it to the docs so that other people know about it.

What about my other question?

Cheers,

Zenshi.


- mrkipling - 2011-11-07

Zenshi Wrote:No problem, just remember to add it to the docs so that other people know about it.

What about my other question?

Cheers,

Zenshi.

Serving from a location other than root? I'm not entirely sure, but it should be possible to do now, I think? Although I haven't tried to do so myself.


- drdextro - 2011-11-07

Hi there,

I really love youre work so far. I got it to work on a win7 machine and OSX atm.

Also I commited a little add for the Sabnzbd module.

Keep up the good work!


- m3g4tr0n - 2011-11-08

drdextro Wrote:Hi there,

I really love youre work so far. I got it to work on a win7 machine and OSX atm.

Also I commited a little add for the Sabnzbd module.

Keep up the good work!

is it working from Apache?


- DejaVu - 2011-11-08

I've been looking at trying to get the Application links to open in 90% x 90% iFrames using the modal box that's already in place (when Adding Modules) - as per example on Fancybox.net (75% Iframe link).

It's a shame that visiting the outside programs closes Maraschino completely.
Can this be added relatively easy?