File: setup.py

package info (click to toggle)
oggconvert 0.3.1-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 376 kB
  • ctags: 112
  • sloc: python: 828; makefile: 36
file content (59 lines) | stat: -rw-r--r-- 2,053 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/python

#
#
# OggConvert -- Converts media files to Free formats
# (c) 2007 Tristan Brindle <t.c.brindle at gmail dot com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# 
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
#

import os
from os import path
import re
from distutils.core import setup
from OggConvert import ocv_info

data_files=[('share/applications/', ['data/oggconvert.desktop']),
            ('share/pixmaps/',['data/oggconvert.svg']) ]


# Freshly generate .mo from .po, add to data_files:
# This copied directly from KungFu, thanks Jason!
if path.isdir('mo/'):
	os.system ('rm -r mo/')
for name in os.listdir('po'):
	m = re.match(r'(.+)\.po$', name)
	if m != None:
		lang = m.group(1)
		out_dir = 'mo/%s/LC_MESSAGES' % lang
		out_name = path.join(out_dir, 'oggconvert.mo')
		install_dir = 'share/locale/%s/LC_MESSAGES/' % lang		
		os.makedirs(out_dir)
  		os.system('msgfmt -o %s po/%s' % (out_name, name))
		data_files.append((install_dir, [out_name])) 

setup(name='oggconvert',
      version=ocv_info.version,
      author='Tristan Brindle',
      author_email='t.c.brindle at gmail dot com',
      description='A simple Gnome application to convert media to Free formats',
      url = 'http://oggconvert.tristanb.net',
      license='GNU LGPL',
      packages=['OggConvert'],
      package_data={'OggConvert' : ['*.glade']},
      scripts=['oggconvert'],
      data_files=data_files
     )