Changeset 0edb535


Ignore:
Timestamp:
04/27/12 13:12:46 (2 years ago)
Author:
yomguy <yomguy@…>
Branches:
social
Children:
5c2f3e8
Parents:
c501d80 (diff), fad4d14 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
yomguy <yomguy@…> (04/27/12 13:12:46)
git-committer:
yomguy <yomguy@…> (04/27/12 13:12:46)
Message:

Merge branch 'master' into social

Conflicts:

example/sandbox_sqlite/settings.py

Files:
136 added
5 edited

Legend:

Unmodified
Added
Removed
  • example/sandbox_sqlite/settings.py

    rc501d80 r0edb535  
    157157TELEMETA_DOWNLOAD_FORMATS = ('wav', 'mp3', 'webm') 
    158158TELEMETA_PUBLIC_ACCESS_PERIOD = 51 
     159TELEMETA_DEFAULT_WAVEFORM_SIZES = ['360x130', '640x130'] 
     160 
    159161AUTH_PROFILE_MODULE = 'telemeta.userprofile' 
    160162SESSION_EXPIRE_AT_BROWSER_CLOSE = False 
  • telemeta/models/media.py

    raf2a6ed rfad4d14  
    3636#          Guillaume Pellerin <yomguy@parisson.com> 
    3737 
     38import re 
     39import mimetypes 
    3840from django.contrib.auth.models import User 
    3941from django.utils.translation import ugettext_lazy as _ 
     
    4244from telemeta.models.enum import ContextKeyword 
    4345from telemeta.util.unaccent import unaccent_icmp 
    44 import re 
    45 import mimetypes 
    4646from telemeta.models.location import LocationRelation, Location 
    4747from telemeta.models.system import Revision 
  • telemeta/models/system.py

    r2592b8e rfad4d14  
    8484    user            = ForeignKey(User, unique=True, required=True) 
    8585    institution     = CharField(_('Institution')) 
     86    department      = CharField(_('Department')) 
     87    attachment      = CharField(_('attachment')) 
    8688    function        = CharField(_('Function')) 
    8789    address         = TextField(_('Address')) 
  • telemeta/views/base.py

    rb7b071c re12b60a8  
    631631            grapher_id = request.REQUEST['grapher_id'] 
    632632        else: 
    633             grapher_id = 'waveform' 
     633            try: 
     634                grapher_id = settings.TELEMETA_DEFAULT_GRAPHER_ID 
     635            except: 
     636                grapher_id = 'waveform' 
    634637 
    635638        previous, next = self.item_previous_next(item) 
     
    682685            grapher_id = request.REQUEST['grapher_id'] 
    683686        else: 
    684             grapher_id = 'waveform' 
     687            try: 
     688                grapher_id = settings.TELEMETA_DEFAULT_GRAPHER_ID 
     689            except: 
     690                grapher_id = 'waveform' 
    685691 
    686692        previous, next = self.item_previous_next(item) 
     
    831837            analyzers = [] 
    832838            analyzers_sub = [] 
     839            graphers_sub = [] 
     840 
    833841            if item.file: 
    834842                decoder  = timeside.decoder.FileDecoder(item.file.path) 
    835843                pipe = decoder 
     844 
    836845                for analyzer in self.analyzers: 
    837846                    subpipe = analyzer() 
    838847                    analyzers_sub.append(subpipe) 
    839848                    pipe = pipe | subpipe 
     849 
     850                try: 
     851                    sizes = settings.TELEMETA_DEFAULT_GRAPHER_SIZES 
     852                except: 
     853                    sizes = ['360x130', ] 
     854 
     855                for grapher in self.graphers: 
     856                    for size in sizes: 
     857                        width = size.split('x')[0] 
     858                        height = size.split('x')[1] 
     859                        image_file = '.'.join([item.public_id, grapher.id(), size.replace('x', '_'), 'png']) 
     860                        path = self.cache_data.dir + os.sep + image_file 
     861                        graph = grapher(width = int(width), height = int(height)) 
     862                        graphers_sub.append({'graph' : graph, 'path': path}) 
     863                        pipe = pipe | graph 
     864 
    840865                pipe.run() 
     866 
     867                for grapher in graphers_sub: 
     868                    grapher['graph'].watermark('timeside', opacity=.6, margin=(5,5)) 
     869                    f = open(grapher['path'], 'w') 
     870                    grapher['graph'].render(grapher['path']) 
     871                    f.close() 
    841872 
    842873                mime_type = decoder.format() 
  • telemeta/templates/telemeta/base.html

    r2c4c2e5b rb166a2e  
    6464<img src="{% url telemeta-images "logout.png" %}" alt="logout" style="vertical-align:middle" /></a> 
    6565{% else %} 
     66<div style="float: left;"> 
    6667<a href="{% url telemeta-flatpage "help" %}">{% trans "Help" %}</a> | 
    67 <a href="{% url telemeta-login %}">{% trans "Sign in" %}</a> 
     68<a href="{% url telemeta-login %}?next={{ request.path|urlencode }}">{% trans "Sign in" %}</a> 
     69</div> 
     70<div style="float: right;;"> 
     71{% load facebook %} 
     72{% facebook_button %} 
     73</div> 
    6874{% endif %} 
    6975</div> 
Note: See TracChangeset for help on using the changeset viewer.