Changeset e12b60a
- Timestamp:
- 04/19/12 16:26:20 (13 months ago)
- Branches:
- master, crem, crem2, dev, diadems, generic, instru_search, lam, nlivemulti, production, release/1.4.4, security, social, storage, test
- Children:
- 57305a5, 14be432
- Parents:
- 8540e78
- git-author:
- yomguy <yomguy@…> (04/19/12 16:26:20)
- git-committer:
- yomguy <yomguy@…> (04/19/12 16:26:20)
- Files:
-
- 2 edited
-
example/sandbox_sqlite/settings.py (modified) (2 diffs)
-
telemeta/views/base.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
example/sandbox_sqlite/settings.py
rae93183 re12b60a 150 150 TELEMETA_DOWNLOAD_FORMATS = ('wav', 'mp3', 'webm') 151 151 TELEMETA_PUBLIC_ACCESS_PERIOD = 51 152 TELEMETA_DEFAULT_WAVEFORM_SIZES = ['360x130', '640x130'] 153 152 154 AUTH_PROFILE_MODULE = 'telemeta.userprofile' 153 155 SESSION_EXPIRE_AT_BROWSER_CLOSE = False … … 155 157 EMAIL_HOST = 'localhost' 156 158 DEFAULT_FROM_EMAIL = 'webmaster@parisson.com' 159 -
telemeta/views/base.py
rb7b071c re12b60a 631 631 grapher_id = request.REQUEST['grapher_id'] 632 632 else: 633 grapher_id = 'waveform' 633 try: 634 grapher_id = settings.TELEMETA_DEFAULT_GRAPHER_ID 635 except: 636 grapher_id = 'waveform' 634 637 635 638 previous, next = self.item_previous_next(item) … … 682 685 grapher_id = request.REQUEST['grapher_id'] 683 686 else: 684 grapher_id = 'waveform' 687 try: 688 grapher_id = settings.TELEMETA_DEFAULT_GRAPHER_ID 689 except: 690 grapher_id = 'waveform' 685 691 686 692 previous, next = self.item_previous_next(item) … … 831 837 analyzers = [] 832 838 analyzers_sub = [] 839 graphers_sub = [] 840 833 841 if item.file: 834 842 decoder = timeside.decoder.FileDecoder(item.file.path) 835 843 pipe = decoder 844 836 845 for analyzer in self.analyzers: 837 846 subpipe = analyzer() 838 847 analyzers_sub.append(subpipe) 839 848 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 840 865 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() 841 872 842 873 mime_type = decoder.format()
Note: See TracChangeset
for help on using the changeset viewer.
