Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

0.1.6 release

  • Loading branch information...
commit e89ca304465c0563e5cd3513568bb179ba2345b6 1 parent a8b68e6
@ralfonso authored
View
8 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
View
20 README
@@ -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
View
9 package.sh
@@ -1,9 +0,0 @@
-#!/bin/sh
-SELF=$(cd $(dirname $0); pwd -P)/
-VERSION=0.1.5
-NAME="theory-${VERSION}"
-
-cd "$SELF/.."
-cp -Rp theory "${NAME}"
-tar jcvf "${NAME}.tar.bz2" --exclude-from=theory/tar_exclude --exclude-vcs ${NAME}
-rm -rf "${NAME}"
View
2  run-dev.sh
@@ -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"
View
2  run-theory.sh
@@ -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() {
View
65 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()
View
47 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()
View
1  server.ini
@@ -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
View
3  tar_exclude
@@ -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
View
2  theory/config/middleware.py
@@ -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
View
4 theory/controllers/main.py
@@ -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 *
@@ -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:
View
5 theory/controllers/mpdcontrol.py
@@ -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
View
1  theory/lib/app_globals.py
@@ -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):
View
1  theory/templates/artists.html
@@ -13,6 +13,7 @@
body {
margin:0;
padding:0;
+ background-color:#eeeeee;
}
</style>
View
2  theory/templates/control.html
@@ -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>
Please sign in to comment.
Something went wrong with that request. Please try again.