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

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for XBMC (/forumdisplay.php?fid=116)
+--- Thread: Maraschino (formerly HTPC Frontend) - a summary web interface for your XBMC HTPC (/showthread.php?tid=113136)



- DejaVu - 2011-11-13 04:06

gugahoi Wrote:I read a little bit about the path functions in python. It's possible it's a os compatibility problem? Are you running on windows?

Nope. Ubuntu 10.04 LTS (XBMCLive updated to Pre-Eden).

My installation directory is @ /home/xbmc/.maraschino


- gugahoi - 2011-11-13 04:33

DejaVu Wrote:Nope. Ubuntu 10.04 LTS (XBMCLive updated to Pre-Eden).

My installation directory is @ /home/xbmc/.maraschino

I'll try and find a solution tomorrow. Gotta study for my last exam ...

On another note. I managed to get a pause/resume functionality for the sabnzbd widget. Just like we had on mfp. One thing that does not seem to happen is the auto-refresh of the widget tho.... I'm not sure why since I thought ajax handled that despite whatever else was happening...? I'll put up this little mod on my repo soon and make the pull request. If MrK likes it, he can add it to his repo and probably polish the code too...


- DejaVu - 2011-11-13 05:15

Good luck with your exam G. Smile
Is the refresh set when you 'Add Application' under 'Poll Frequency (Seconds)'? Cant say I checked TBH.

Got a bit bored with a 'Saturday Night in!'

So tweaked the CSS for my Drive Widget a tad.
I love the way everything can still be editted with simple Web Knowledge BTW!

Only really wanna quick glance at see the state of the disks, not to bothered about the decimal places either, but could not get my head around rounding it up...

Percentage follows the bar -

[Image: maraschinodisk.jpg]


- _Mikie_ - 2011-11-13 08:34

DejaVu Wrote:Good luck with your exam G. Smile
Is the refresh set when you 'Add Application' under 'Poll Frequency (Seconds)'? Cant say I checked TBH.

Got a bit bored with a 'Saturday Night in!'

So tweaked the CSS for my Drive Widget a tad.
I love the way everything can still be editted with simple Web Knowledge BTW!

Only really wanna quick glance at see the state of the disks, not to bothered about the decimal places either, but could not get my head around rounding it up...

Percentage follows the bar -

[Image: maraschinodisk.jpg]

If you don't want the decimals then somewhere around line 102

free = float(st.f_bavail * st.f_frsize) / 1073741824
total = float(st.f_blocks * st.f_frsize) / 1073741824
used = float((st.f_blocks - st.f_bfree) * st.f_frsize) / 1073741824

These shouldn't be floating numbers.


- mrkipling - 2011-11-13 13:08

DejaVu Wrote:Still a no go on this.
It seems as though Python does not recognise it's 'working directory' and is defaulting to the root directory searching for the images.

Is this what the problem is or am I way off base?

Yep, I think that different servers have different ideas of what it should be using as the working directory.

Anyway, I've pushed another change. It starts with the current working directory; it then attempts to prepend the path from sys.path (which works in Apache); then it tries to get the icons. If successful it displays them using a dropdown, otherwise it falls back to using an input text box. There's probably a super-easy, super-nice way of doing this, but I don't know it and don't have the time to figure it out right now unfortunately, and at least this shouldn't break anything Smile


- mrkipling - 2011-11-13 13:14

gugahoi Wrote:Awesome, it's exactly as I thought it was. I only overlooked the hook.

One thing I noticed tho is that all the py files end up having a pyc file except for the module I created. It does show up in the page fine however.

Another quick question I have: how do you debug some of the code? As in, variables for example. How do you check the content of a variable? Can I just print it to the console or would I have to pass it to the template and use some special printing there?

*.pyc files are created by Python, they're just compiled version of the *.py files. They are in .gitignore and can be safely deleted, they'll just get re-made by Python.

For simple debugging you can just use

Code:
print variablename

in the Python code to print it to the console.


- mrkipling - 2011-11-13 13:21

_Mikie_ Wrote:If you don't want the decimals then somewhere around line 102

free = float(st.f_bavail * st.f_frsize) / 1073741824
total = float(st.f_blocks * st.f_frsize) / 1073741824
used = float((st.f_blocks - st.f_bfree) * st.f_frsize) / 1073741824

These shouldn't be floating numbers.

When talking in GB I prefer them being displayed to 2 decimal places, but if you don't then you could just use Jinja's built-in "int" template filter, like so (in "templates/diskspace.html"):

Code:
{{ disk.used|int }} GB used



- DejaVu - 2011-11-13 22:00

Awesome - thanks for that MrK.

Also, the latest commit for the Image dropdown seems to be working for me too on the CherryPy install.


- Rumik - 2011-11-14 16:53

At first glance the installation instructions on the website seem to assume you're using Linux... are there no Windows installation instructions? Can this even run on Windows?


- DejaVu - 2011-11-14 17:13

It is originally created for Linux, but Python is universal and can run on Linux, Apple Mac's and Windows.

Look through this thread and check Archigos' posts, he has this running in a Windows environment.