~ubuntu-branches/debian/jessie/subdownloader/jessie

« back to all changes in this revision

Viewing changes to modules/mmpython/__init__.py

  • Committer: Package Import Robot
  • Author(s): Emilien Klein, Jakub Wilk, Emilien Klein
  • Date: 2014-10-22 00:09:01 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20141022000901-968rxi9a15icm032
Tags: 2.0.18-1
* New upstream release (Closes: #687126, #751920).

[ Jakub Wilk ]
* Use canonical URIs for Vcs-* fields.
* Fix watch file.

[ Emilien Klein ]
* Transition from python_support to dh_python2. Affects files:
  - d/control
  - d/rules
  - d/subdownloader.install
  - d/subdownloader.links
* d/control:
  - Bump Standards-Version from 3.9.1 to 3.9.6 (one change performed to
    d/rules recommended target)
  - Replace Marco Rodrigues by myself in Uploaders
* d/rules: Fix debian-rules-missing-recommended-target Lintian warning
* d/patches/fix-non-ascii-download-path.patch: deleted as applied upstream
* d/patches/desktop-file-remove-path.patch: make the desktop file usable
* d/patches/no-mime-type-in-desktop-file.patch: Mime Type is unused, as
    the .desktop file doesn't provide an Exec code.
* d/patches/resize-icon.patch: Resize icon from 64x64 to 32x32

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
#if 0
 
3
# -----------------------------------------------------------------------
 
4
# $Id: __init__.py 382 2004-10-15 09:02:11Z dischi $
 
5
# -----------------------------------------------------------------------
 
6
# $Log$
 
7
# Revision 1.35  2004/10/15 09:02:11  dischi
 
8
# add ac3 parser
 
9
#
 
10
# Revision 1.34  2004/05/20 15:55:08  dischi
 
11
# add xml file detection
 
12
#
 
13
# Revision 1.33  2004/05/02 08:28:20  dischi
 
14
# dvd iso support
 
15
#
 
16
# Revision 1.32  2004/04/18 09:11:36  dischi
 
17
# improved lsdvd support
 
18
#
 
19
# Revision 1.31  2004/04/17 18:38:54  dischi
 
20
# add lsdvd parser to avoid problems with our own
 
21
#
 
22
# Revision 1.30  2004/01/31 12:24:39  dischi
 
23
# add basic matroska info
 
24
#
 
25
# Revision 1.29  2004/01/27 20:27:52  dischi
 
26
# remove cache, it does not belong in mmpython
 
27
#
 
28
# Revision 1.28  2004/01/03 17:44:04  dischi
 
29
# catch OSError in case the file is removed file scanning
 
30
#
 
31
# Revision 1.27  2003/11/24 20:30:17  dischi
 
32
# fix again, dvd may fail, but datadir may not
 
33
#
 
34
# Revision 1.26  2003/11/24 20:29:26  dischi
 
35
# resort to let dvd work again
 
36
#
 
37
# Revision 1.25  2003/11/07 13:58:52  dischi
 
38
# extra check for dvd
 
39
#
 
40
# Revision 1.24  2003/09/22 16:24:58  the_krow
 
41
# o added flac
 
42
# o try-except block around ioctl since it is not avaiable in all OS
 
43
#
 
44
# Revision 1.23  2003/09/14 13:50:42  dischi
 
45
# make it possible to scan extention based only
 
46
#
 
47
# Revision 1.22  2003/09/10 18:41:44  dischi
 
48
# add USE_NETWORK, maybe there is no network connection
 
49
#
 
50
# Revision 1.20  2003/08/26 13:16:41  outlyer
 
51
# Enabled m4a support
 
52
#
 
53
# Revision 1.19  2003/07/10 11:17:35  the_krow
 
54
# ogminfo is used to parse ogg files
 
55
#
 
56
# Revision 1.18  2003/07/01 21:07:42  dischi
 
57
# switch back to eyed3info
 
58
#
 
59
# Revision 1.17  2003/06/30 13:17:18  the_krow
 
60
# o Refactored mediainfo into factory, synchronizedobject
 
61
# o Parsers now register directly at mmpython not at mmpython.mediainfo
 
62
# o use mmpython.Factory() instead of mmpython.mediainfo.get_singleton()
 
63
# o Bugfix in PNG parser
 
64
# o Renamed disc.AudioInfo into disc.AudioDiscInfo
 
65
# o Renamed disc.DataInfo into disc.DataDiscInfo
 
66
#
 
67
# -----------------------------------------------------------------------
 
68
# MMPython - Media Metadata for Python
 
69
# Copyright (C) 2003 Thomas Schueppel, Dirk Meyer
 
70
#
 
71
# This program is free software; you can redistribute it and/or modify
 
72
# it under the terms of the GNU General Public License as published by
 
73
# the Free Software Foundation; either version 3 of the License, or
 
74
# (at your option) any later version.
 
75
#
 
76
# This program is distributed in the hope that it will be useful, but
 
77
# WITHOUT ANY WARRANTY; without even the implied warranty of MER-
 
78
# CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
 
79
# Public License for more details.
 
80
#
 
81
# You should have received a copy of the GNU General Public License along
 
82
# with this program; if not, write to the Free Software Foundation, Inc.,
 
83
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
84
 
85
# -----------------------------------------------------------------------
 
86
#endif
 
87
 
 
88
# Do this stuff before importing the info instances since they 
 
89
# depend on this function
 
90
 
 
91
import factory
 
92
from synchronizedobject import SynchronizedObject
 
93
 
 
94
_factory = SynchronizedObject(factory.Factory())
 
95
 
 
96
#def Factory():
 
97
#    global _factory
 
98
#
 
99
#    print _factory
 
100
#    # One-time init
 
101
#    if _factory == None:
 
102
#        _factory = SynchronizedObject(factory.Factory())
 
103
#        
 
104
#    return _factory
 
105
 
 
106
def registertype(mimetype,extensions,type,c):
 
107
    #f = _factory
 
108
    _factory.register(mimetype,extensions,type,c)    
 
109
 
 
110
def gettype(mimetype,extensions):
 
111
    #f = _factory
 
112
    return _factory.get(mimetype,extensions)    
 
113
    
 
114
USE_NETWORK = 1
 
115
 
 
116
def parse(filename, ext_only = 0):
 
117
    """
 
118
    parse the file
 
119
    """
 
120
    return _factory.create(filename, ext_only)
 
121
 
 
122
# Okay Regular imports and code follow
 
123
 
 
124
import sys
 
125
import os
 
126
import mediainfo
 
127
import video.riffinfo
 
128
import video.mpeginfo
 
129
import video.asfinfo
 
130
import video.movinfo
 
131
import video.vcdinfo
 
132
import video.realinfo
 
133
import video.ogminfo
 
134
import video.mkvinfo
 
135
import misc.xmlinfo
 
136
registertype( 'video/asf', ('asf','wmv','wma'), mediainfo.TYPE_AV, video.asfinfo.AsfInfo )
 
137
registertype( 'application/mkv', ('mkv', 'mka',), mediainfo.TYPE_AV, video.mkvinfo.MkvInfo )
 
138
registertype( 'video/quicktime', ('mov', 'qt'), mediainfo.TYPE_AV, video.movinfo.MovInfo )
 
139
registertype( 'video/mpeg', ('mpeg','mpg','mp4', 'ts'), mediainfo.TYPE_AV, video.mpeginfo.MpegInfo )
 
140
registertype( 'application/ogg', ('ogm', 'ogg',), mediainfo.TYPE_AV, video.ogminfo.OgmInfo )
 
141
registertype( 'video/real', ('rm', 'ra', 'ram'), mediainfo.TYPE_AV, video.realinfo.RealInfo )
 
142
registertype( 'video/avi', ('avi',), mediainfo.TYPE_AV, video.riffinfo.RiffInfo )
 
143
registertype( 'video/vcd', ('cue',), mediainfo.TYPE_AV, video.vcdinfo.VCDInfo )
 
144
#import audio.ogginfo
 
145
#import audio.pcminfo
 
146
#import audio.m4ainfo
 
147
#import audio.ac3info
 
148
#import image.jpginfo
 
149
#import image.pnginfo
 
150
#import image.tiffinfo
 
151
#import image.ImageInfo
 
152
 
 
153
# import some disc modules (may fail)
 
154
#try:
 
155
#    import disc.discinfo
 
156
#    import disc.vcdinfo
 
157
#    import disc.audioinfo
 
158
#except ImportError:
 
159
#    pass
 
160
#
 
161
# find the best working DVD module
 
162
#try:
 
163
#    import disc.lsdvd
 
164
#except ImportError:
 
165
#    pass
 
166
#
 
167
#try:
 
168
#    import disc.dvdinfo
 
169
#except ImportError:
 
170
#    pass
 
171
#
 
172
# use fallback disc module
 
173
#try:
 
174
#    import disc.datainfo
 
175
#except ImportError:
 
176
#    pass
 
177
 
 
178
#import audio.eyed3info
 
179
#import audio.mp3info
 
180
#import audio.webradioinfo
 
181
#import audio.flacinfo
 
182
 
 
183