Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
doki_pen
committed
Jan 19, 2010
0 parents
commit f586d76
Showing
8 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.pyc | ||
*.egg-info | ||
build | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env python | ||
""" | ||
License: BSD | ||
(c) 2009 ::: Robert Corsaro (doki_pen@doki-pen.org) | ||
""" | ||
|
||
from setuptools import setup, find_packages | ||
|
||
setup( | ||
name='TracXspfPlugin', | ||
version='0.11', | ||
license='BSD', | ||
author='Robert Corsaro', | ||
author_email='doki_pen@doki-pen.org', | ||
url='http://github.com/dokipen', | ||
description='Xspf flash mp3 player macros', | ||
zip_safe=True, | ||
packages=['tracxspf'], | ||
package_data={ | ||
'tracxspf': ['templates/*.html', 'htdocs/*.swf'] | ||
}, | ||
entry_points={ | ||
'trac.plugins': [ | ||
'tracxspf.macros = tracxspf.macros', | ||
'tracxspf.web_ui = tracxspf.web_ui', | ||
] | ||
}, | ||
) |
Empty file.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- coding: utf-8 -*- | ||
from trac.core import * | ||
|
||
from trac.web.chrome import Chrome | ||
from trac.wiki.api import parse_args | ||
from trac.wiki.macros import WikiMacroBase | ||
from trac.util.html import escape | ||
|
||
class XspfButtonMacro(WikiMacroBase): | ||
def expand_macro(self, formatter, name, content): | ||
_, kw = parse_args(content) | ||
song_url = "/raw-attachment/wiki"\ | ||
"/%s/%s"%(formatter.resource.id, kw.get('attachment')) | ||
name = kw.get('name', 'Unknown') | ||
artist = kw.get('artist', 'Unknown') | ||
song_title = escape("%s - %s"%(name, artist)) | ||
data = Chrome(self.env).populate_data(formatter.req, { | ||
'song_url': song_url, | ||
'song_title': song_title, | ||
'name': name, | ||
'artist': artist | ||
}); | ||
return Chrome(self.env).load_template('xspf.html').\ | ||
generate(**data) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:py="http://genshi.edgewall.org/" | ||
py:strip="True"> | ||
<a href="${song_url}"><b>${name}</b></a> - <em>${artist}</em> <a href="${song_url}"><img src="${href('chrome', 'common', 'download.png')}"/></a><br/> | ||
<object width="400" height="20" data="${href('chrome', 'tracxspf', 'slim_player.swf')}?song_url=${song_url}&song_title=${song_title}" type="application/x-shockwave-flash"> | ||
<param name="player_title" value="Xspf : ${song_title}" /> | ||
<param name="movie" value="${href('chrome', 'tracxspf', 'slim_player.swf')}?song_url=${song_url}&song_title=${song_title}" /> | ||
</object> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from trac.core import * | ||
from trac.web.chrome import ITemplateProvider | ||
|
||
class XspfView(Component): | ||
implements(ITemplateProvider) | ||
|
||
def get_templates_dirs(self): | ||
from pkg_resources import resource_filename | ||
return [resource_filename(__name__, 'templates')] | ||
|
||
def get_htdocs_dirs(self): | ||
from pkg_resources import resource_filename | ||
return [('tracxspf', resource_filename(__name__, 'htdocs'))] |