Skip to content
This repository has been archived by the owner on Nov 13, 2017. It is now read-only.

Commit

Permalink
0.1.6 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfonso committed Jan 3, 2009
1 parent a8b68e6 commit e89ca30
Show file tree
Hide file tree
Showing 15 changed files with 146 additions and 26 deletions.
8 changes: 8 additions & 0 deletions Changelog
@@ -1,3 +1,11 @@
0.1.6
added logo and logo generation script
fix for configuring a used, but invalid port
fix for fullscreen status when the current track is the last in the playlist
fix for song changing to a track with the same title
fix for null artist names. MPD bug, bad encoding?
moved playlist back to hover() so it detects child hovers properly

0.1.5
added basic filesystem browsing
getStatus() javascript partial rewrite
Expand Down
20 changes: 14 additions & 6 deletions README
Expand Up @@ -7,13 +7,21 @@ to http://localhost:9099/ if you're running theory locally

##########################

This is only my third Python project and my second Pylons app. Suggestions / bug fixes / pointing out
my non-Pythonic idioms are all welcome. Most layout values / colors are in the CSS file theory/public/css/styles.css.
I'd like to add support for themes, but you should be able to edit the CSS file if you don't like the color scheme.
notes:
* This is only my third Python project and my second Pylons app. Suggestions / bug fixes / pointing out
my non-Pythonic idioms are all welcome. Most layout values / colors are in the CSS file theory/public/css/styles.css.
I'd like to add support for themes, but you should be able to edit the CSS file if you don't like the color scheme.

theory is Firefox only for now. I have no desire to support IE and I don't have access to any OSX-based browsers. jquery is cross-browser so Opera should work pretty well, but I haven't tested it.
* theory is Firefox only for now. I have no desire to support IE and I don't have access to any OSX-based browsers.
jquery is cross-browser so Opera should work pretty well, but I haven't tested it.

known bugs:
* there is a bug in jquery that will throw an "easing" error occasionally
* unicode support doesn't appear to be completely sorted. I've fixed the
bugs that are causes by my collection, but there might be some lingerers

upgrading:
* if you're upgrading from a previous version of theory, you might want to copy your theory.ini over from the
old installation directory. Server info, Amazon AWS key, and saved streams are stored in that file. You should also
consider copying the downloaded album art stored in theory-OLDVERSION/theory/public/img/art/ to avoid
re-downloading all of those images.

contact: ralfonso@gmail.com
9 changes: 0 additions & 9 deletions package.sh

This file was deleted.

2 changes: 1 addition & 1 deletion run-dev.sh
Expand Up @@ -6,4 +6,4 @@ then
echo "please install the prerequisites by using the included install.sh script"
exit
fi
"$SELF/env/bin/paster" serve --daemon --reload "$SELF/development.ini"
"$SELF/env/bin/paster" serve --reload "$SELF/development.ini"
2 changes: 1 addition & 1 deletion run-theory.sh
Expand Up @@ -9,7 +9,7 @@ start() {
exit
fi
echo "starting theory"
"$SELF/env/bin/paster" serve --daemon --reload "$SELF/server.ini"
"$SELF/env/bin/paster" serve --daemon --reload --log-file "$SELF/theory.log" "$SELF/server.ini" && echo "theory started, http://localhost:9099/ if you're using the default port"
}

stop() {
Expand Down
65 changes: 65 additions & 0 deletions scripts/draw_theory_logo.py
@@ -0,0 +1,65 @@
#!/usr/bin/env python

import pangocairo
import cairo
import pango
import sys
from gtk import gdk

def usage():
print "usage: draw_theory_logo.py VERSION OUTPUTFILE"

def set_context_color(c,color):
col = gdk.color_parse(color)
r = float(col.red) / 65535
g = float(col.green) / 65535
b = float(col.blue) / 65535
c.set_source_rgb(r,g,b)

def main():
if len(sys.argv) != 3:
usage()
sys.exit(1)

version = sys.argv[1]
imgpath = sys.argv[2]

surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 140,24)
ctx = cairo.Context(surface)
c = pangocairo.CairoContext(ctx)

l = c.create_layout()
font_desc = pango.FontDescription('Grixel Acme 7 Wide Bold 14')
l.set_font_description(font_desc)
fo = cairo.FontOptions()
fo.set_antialias(cairo.ANTIALIAS_NONE)

c.set_font_options(fo)
pangocairo.context_set_font_options (l.get_context(), fo)
l.set_text('theory')
set_context_color(ctx,'#333333')
ctx.move_to(4,-8)
c.show_layout(l)
c.update_layout(l)


l = c.create_layout()
font_desc = pango.FontDescription('Grixel Acme 7 Wide 7')
attr = pango.AttrList()
attr.insert(pango.AttrLetterSpacing(1200,0,100))
l.set_attributes(attr)
l.set_font_description(font_desc)
fo = cairo.FontOptions()
fo.set_antialias(cairo.ANTIALIAS_NONE)
pangocairo.context_set_font_options (l.get_context(), fo)
l.set_text(version)
ctx.move_to(105,8)
ctx.set_source_rgb (.33,.33,.33)

c.show_layout(l)
c.update_layout(l)

surface.write_to_png(imgpath)

if __name__ == "__main__":
main()
47 changes: 47 additions & 0 deletions scripts/package.py
@@ -0,0 +1,47 @@
#!/usr/bin/env python

import os
import shutil
import sys
import subprocess
import cairo


def main():
version = '0.1.6'

script_location = sys.argv[0]
script_path = os.path.abspath(script_location)
app_path = os.sep.join(script_path.split(os.sep)[:-3])

src = os.path.join(app_path,'theory')
dest = os.path.join(app_path,"theory-%s" % version)
tar_file = os.path.join(app_path,"theory-%s.tar.bz2" % version)
exclude_file = os.path.join(src,"tar_exclude")

# draw logo
imgpath = os.path.join(app_path,'theory','theory','public','img','theory-logo.png')
logo_exec = os.path.join(app_path,'theory','scripts','draw_theory_logo.py')

args = [logo_exec,version,imgpath]
subprocess.call(args)

# remove destination dir in case it exists
try:
shutil.rmtree(dest)
except OSError:
pass
shutil.copytree(src,dest)

os.chdir(app_path)

args = ["tar","jcvf",tar_file,"--exclude-from=%s" % exclude_file,"--exclude-vcs","theory-%s" % version]

subprocess.call(args)


def exclude_check(f):
print "check_exclude: %s" % f

if __name__ == "__main__":
main()
1 change: 0 additions & 1 deletion server.ini
Expand Up @@ -22,7 +22,6 @@ cache_dir = %(here)s/data
beaker.session.key = theory
beaker.session.secret = barf
localconf = theory.ini
version = 0.1.5

#beaker.cache.data_dir = %(here)s/data/cache
#beaker.session.data_dir = %(here)s/data/sessions
Expand Down
3 changes: 2 additions & 1 deletion tar_exclude
Expand Up @@ -15,7 +15,8 @@ theory-*/env
theory-*/theory.ini
theory-*/development.ini
theory-*/run-dev.sh
theory-*/package.sh
theory-*/scripts/*
theory-*/scripts
theory-*/package.py
theory-*/theory/public/img/art/*
theory-*/tar_exclude
Expand Down
2 changes: 1 addition & 1 deletion theory/config/middleware.py
Expand Up @@ -62,5 +62,5 @@ def make_app(global_conf, full_stack=True, **app_conf):
# server is handling this static content, remove the following 3 lines)
static_app = StaticURLParser(config['pylons.paths']['static_files'])
app = Cascade([static_app, app])
#app = TransLogger(app, setup_console_handler=False)
app = TransLogger(app, setup_console_handler=False)
return app
4 changes: 2 additions & 2 deletions theory/controllers/main.py
Expand Up @@ -25,7 +25,7 @@

from theory.lib.base import BaseController, render
from theory.lib import helpers as h
from theory.model.mpdpool import ConnectionClosed,IncorrectPassword
from theory.model.mpdpool import ConnectionClosed,IncorrectPassword,ProtocolError
from theory.model.albumart import AlbumArt,NoArtError
from theory.model.lyrics import *

Expand All @@ -43,7 +43,7 @@ def index(self):

try:
g.p.connect()
except ConnectionClosed:
except (ProtocolError,ConnectionClosed):
if g.tc.server is None:
g.tc = TConfig()
if g.tc.server is None:
Expand Down
5 changes: 3 additions & 2 deletions theory/controllers/mpdcontrol.py
Expand Up @@ -68,8 +68,9 @@ def fs_status(self):
if found_current:
remaining_playlist.append(pl)

if pl['id'] == current['id']:
found_current = True
if current.has_key('id'):
if pl['id'] == current['id']:
found_current = True

track += 1

Expand Down
1 change: 0 additions & 1 deletion theory/lib/app_globals.py
Expand Up @@ -22,7 +22,6 @@ def __init__(self):
self.p = QueuePool(self.get_mpd_conn, max_overflow=0, pool_size=2, use_threadlocal=True)
self.tc = TConfig()
self.get_genres()
self.version = config.get('version','')
pass

def get_genres(self):
Expand Down
1 change: 1 addition & 0 deletions theory/templates/artists.html
Expand Up @@ -13,6 +13,7 @@
body {
margin:0;
padding:0;
background-color:#eeeeee;
}
</style>

Expand Down
2 changes: 1 addition & 1 deletion theory/templates/control.html
Expand Up @@ -40,6 +40,6 @@
</div>
</div>

<div id="theory"><a href="http://theory.steelbreeze.org/" target="_blank">theory ${g.version}</a></div>
<div id="theory"><a href="http://theory.steelbreeze.org/" target="_blank"><img src="img/theory-logo.png" /></a></div>
<br />
</div>

0 comments on commit e89ca30

Please sign in to comment.