From aeaa875608d83b9a3545ce97f486085c654f9c08 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 6 Nov 2010 17:14:40 +0100 Subject: [PATCH] move static and files --- pandora/archive/models.py | 8 ++++- pandora/settings.py | 33 +++++++++++------- pandora/urls.py | 2 +- {pandora/static => static}/css/timeline.css | 0 {pandora/static => static}/css/ui.css | 0 {pandora/static => static}/jquery | 0 .../js/ajax_filtered_fields.js | 0 .../static => static}/js/jquery/jquery.js | 0 .../js/jquery/jquery.videosupport.js | 0 {pandora/static => static}/js/pandora.js | 0 .../static => static}/js/pandora.local.js | 0 {pandora/static => static}/js/timeline.js | 0 {pandora/static => static}/js/ui.js | 0 {pandora/static => static}/png/frame.png | Bin {pandora/static => static}/png/icon.16.png | Bin {pandora/static => static}/png/icon.mask.png | Bin .../static => static}/png/logo.poster.png | Bin .../static => static}/png/posterDark.48.png | Bin {pandora/static => static}/png/timeline.png | Bin {pandora/static => static}/robots.txt | 0 .../ttf/DejaVuSansCondensedBold.ttf | Bin 21 files changed, 29 insertions(+), 14 deletions(-) rename {pandora/static => static}/css/timeline.css (100%) rename {pandora/static => static}/css/ui.css (100%) rename {pandora/static => static}/jquery (100%) rename {pandora/static => static}/js/ajax_filtered_fields.js (100%) rename {pandora/static => static}/js/jquery/jquery.js (100%) rename {pandora/static => static}/js/jquery/jquery.videosupport.js (100%) rename {pandora/static => static}/js/pandora.js (100%) rename {pandora/static => static}/js/pandora.local.js (100%) rename {pandora/static => static}/js/timeline.js (100%) rename {pandora/static => static}/js/ui.js (100%) rename {pandora/static => static}/png/frame.png (100%) rename {pandora/static => static}/png/icon.16.png (100%) rename {pandora/static => static}/png/icon.mask.png (100%) rename {pandora/static => static}/png/logo.poster.png (100%) rename {pandora/static => static}/png/posterDark.48.png (100%) rename {pandora/static => static}/png/timeline.png (100%) rename {pandora/static => static}/robots.txt (100%) rename {pandora/static => static}/ttf/DejaVuSansCondensedBold.ttf (100%) diff --git a/pandora/archive/models.py b/pandora/archive/models.py index 5ba090f4..6386b06a 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -278,7 +278,13 @@ class Frame(models.Model): position = models.FloatField() frame = models.ImageField(default=None, null=True, upload_to=frame_path) - #FIXME: frame path should be renamed on save to match current position + ''' + def save(self, *args, **kwargs): + name = "%d.jpg" % self.position + if file.name != name: + #FIXME: frame path should be renamed on save to match current position + super(Frame, self).save(*args, **kwargs) + ''' def __unicode__(self): return u'%s at %s' % (self.file, self.position) diff --git a/pandora/settings.py b/pandora/settings.py index 041a053d..7a3feb65 100644 --- a/pandora/settings.py +++ b/pandora/settings.py @@ -4,9 +4,9 @@ import os from os.path import join -SITENAME = 'Pandora' -SITEID = 'pandora' -URL = 'pan.do/ra' +SITENAME = 'Pan.do/ra' +SITEID = 'pandora' +URL = 'pan.do/ra' PROJECT_ROOT = os.path.normpath(os.path.dirname(__file__)) @@ -67,14 +67,14 @@ APPEND_SLASH = False # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = join(PROJECT_ROOT, 'media') -STATIC_ROOT = join(PROJECT_ROOT, 'static') +MEDIA_ROOT = join(PROJECT_ROOT, '..', 'data') +STATIC_ROOT = join(PROJECT_ROOT, '..', 'static') TESTS_ROOT = join(PROJECT_ROOT, 'tests') # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). # Examples: "http://media.lawrence.com", "http://example.com/media/" -MEDIA_URL = '/media/' +MEDIA_URL = '/data/' STATIC_URL = '/static/' @@ -138,15 +138,24 @@ VIDEO_H264 = False #VIDEO_H264 = False -TRANSMISSON_HOST='localhost' -TRANSMISSON_PORT=9091 -TRANSMISSON_USER='transmission' -TRANSMISSON_PASSWORD='transmission' +TRANSMISSON_HOST = 'localhost' +TRANSMISSON_PORT = 9091 +TRANSMISSON_USER = 'transmission' +TRANSMISSON_PASSWORD = 'transmission' #list of poster services, https://wiki.0x2620.org/wiki/pandora/posterservice -POSTER_SERVICES=[] -POSTER_PRECEDENCE=('local', 'criterion.com', 'wikipedia.org', 'impawards.com', 'movieposterdb.com', 'imdb.com', 'allmovie.com', 'other') +POSTER_SERVICES = [] +POSTER_PRECEDENCE = ( + 'local', + 'criterion.com', + 'wikipedia.org', + 'impawards.com', + 'movieposterdb.com', + 'imdb.com', + 'allmovie.com', + 'other' +) #0xdb.org #POSTER_SERVICES=['http://data.0xdb.org/poster/'] diff --git a/pandora/urls.py b/pandora/urls.py index ce5c8e77..489d84dc 100644 --- a/pandora/urls.py +++ b/pandora/urls.py @@ -39,7 +39,7 @@ urlpatterns = patterns('', if settings.DEBUG: urlpatterns += patterns('', - (r'^media/(?P.*)$', 'django.views.static.serve', + (r'^data/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), (r'^static/(?P.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}), diff --git a/pandora/static/css/timeline.css b/static/css/timeline.css similarity index 100% rename from pandora/static/css/timeline.css rename to static/css/timeline.css diff --git a/pandora/static/css/ui.css b/static/css/ui.css similarity index 100% rename from pandora/static/css/ui.css rename to static/css/ui.css diff --git a/pandora/static/jquery b/static/jquery similarity index 100% rename from pandora/static/jquery rename to static/jquery diff --git a/pandora/static/js/ajax_filtered_fields.js b/static/js/ajax_filtered_fields.js similarity index 100% rename from pandora/static/js/ajax_filtered_fields.js rename to static/js/ajax_filtered_fields.js diff --git a/pandora/static/js/jquery/jquery.js b/static/js/jquery/jquery.js similarity index 100% rename from pandora/static/js/jquery/jquery.js rename to static/js/jquery/jquery.js diff --git a/pandora/static/js/jquery/jquery.videosupport.js b/static/js/jquery/jquery.videosupport.js similarity index 100% rename from pandora/static/js/jquery/jquery.videosupport.js rename to static/js/jquery/jquery.videosupport.js diff --git a/pandora/static/js/pandora.js b/static/js/pandora.js similarity index 100% rename from pandora/static/js/pandora.js rename to static/js/pandora.js diff --git a/pandora/static/js/pandora.local.js b/static/js/pandora.local.js similarity index 100% rename from pandora/static/js/pandora.local.js rename to static/js/pandora.local.js diff --git a/pandora/static/js/timeline.js b/static/js/timeline.js similarity index 100% rename from pandora/static/js/timeline.js rename to static/js/timeline.js diff --git a/pandora/static/js/ui.js b/static/js/ui.js similarity index 100% rename from pandora/static/js/ui.js rename to static/js/ui.js diff --git a/pandora/static/png/frame.png b/static/png/frame.png similarity index 100% rename from pandora/static/png/frame.png rename to static/png/frame.png diff --git a/pandora/static/png/icon.16.png b/static/png/icon.16.png similarity index 100% rename from pandora/static/png/icon.16.png rename to static/png/icon.16.png diff --git a/pandora/static/png/icon.mask.png b/static/png/icon.mask.png similarity index 100% rename from pandora/static/png/icon.mask.png rename to static/png/icon.mask.png diff --git a/pandora/static/png/logo.poster.png b/static/png/logo.poster.png similarity index 100% rename from pandora/static/png/logo.poster.png rename to static/png/logo.poster.png diff --git a/pandora/static/png/posterDark.48.png b/static/png/posterDark.48.png similarity index 100% rename from pandora/static/png/posterDark.48.png rename to static/png/posterDark.48.png diff --git a/pandora/static/png/timeline.png b/static/png/timeline.png similarity index 100% rename from pandora/static/png/timeline.png rename to static/png/timeline.png diff --git a/pandora/static/robots.txt b/static/robots.txt similarity index 100% rename from pandora/static/robots.txt rename to static/robots.txt diff --git a/pandora/static/ttf/DejaVuSansCondensedBold.ttf b/static/ttf/DejaVuSansCondensedBold.ttf similarity index 100% rename from pandora/static/ttf/DejaVuSansCondensedBold.ttf rename to static/ttf/DejaVuSansCondensedBold.ttf