--- deejayd-0.7.2.orig/setup.py +++ deejayd-0.7.2/setup.py @@ -21,16 +21,50 @@ import glob,os from distutils.command.build import build as distutils_build from distutils.core import setup,Command +from distutils.errors import DistutilsFileError +from distutils.dep_util import newer +from distutils.spawn import find_executable + import deejayd -# -# i18n -# + +class build_manpages(Command): + manpages = None + db2man = "/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl" + mandir = "man/" + executable = find_executable('xsltproc') + + def initialize_options(self): + pass + + def finalize_options(self): + self.manpages = glob.glob(os.path.join(self.mandir, "*.xml")) + + def __get_man_section(self, filename): + # filename should be file.mansection.xml + return filename.split('.')[-2] + + def run(self): + data_files = self.distribution.data_files + + for xmlmanpage in self.manpages: + manpage = xmlmanpage[:-4] # remove '.xml' at the end + if newer(xmlmanpage, manpage): + cmd = (self.executable, "--nonet", "-o", self.mandir, + self.db2man, + xmlmanpage) + self.spawn(cmd) + + targetpath = os.path.join("share", "man") + data_files.append((targetpath, (manpage, ), )) + + class build_i18n(Command): user_options = [] po_package = None po_directory = None po_files = None + executable = find_executable('msgfmt') def initialize_options(self): pass @@ -50,7 +84,7 @@ if not os.path.exists(mo_dir): os.makedirs(mo_dir) - cmd = ["msgfmt", po_file, "-o", mo_file] + cmd = (self.executable, po_file, "-o", mo_file) self.spawn(cmd) targetpath = os.path.join("share/locale", lang, "LC_MESSAGES") @@ -59,11 +93,19 @@ class deejayd_build(distutils_build): + def __has_manpages(self, command): + return self.distribution.cmdclass.has_key("build_manpages")\ + and os.path.exists(build_manpages.db2man)\ + and build_manpages.executable != None + + def __has_i18n(self, command): + return self.distribution.cmdclass.has_key("build_i18n")\ + and build_i18n.executable != None + def finalize_options(self): - def has_i18n(command): - return self.distribution.cmdclass.has_key("build_i18n") distutils_build.finalize_options(self) - self.sub_commands.append(("build_i18n", has_i18n)) + self.sub_commands.append(("build_i18n", self.__has_i18n)) + self.sub_commands.append(("build_manpages", self.__has_manpages)) # # data files @@ -100,7 +142,9 @@ package_data={'deejayd.ui': ['defaults.conf'], 'deejayd.webui': ['templates/*.xml']}, data_files= build_data_files_list(), - cmdclass={"build": deejayd_build, "build_i18n": build_i18n} + cmdclass={"build": deejayd_build, + "build_i18n": build_i18n, + "build_manpages": build_manpages,} ) # vim: ts=4 sw=4 expandtab --- deejayd-0.7.2.orig/deejayd/sources/__init__.py +++ deejayd-0.7.2/deejayd/sources/__init__.py @@ -40,7 +40,7 @@ self.sources_obj = {} self.current = "" self.db = db - activated_sources = config.get('general', "activated_modes").split(",") + activated_sources = config.getlist('general', "activated_modes") from deejayd.sources import queue self.sources_obj["queue"] = queue.QueueSource(db, audio_library) --- deejayd-0.7.2.orig/deejayd/mediadb/__init__.py +++ deejayd-0.7.2/deejayd/mediadb/__init__.py @@ -38,7 +38,7 @@ except library.NotFoundException,msg: log.err(_("Unable to init audio library : %s") % msg, fatal = True) - activated_sources = config.get('general', "activated_modes").split(",") + activated_sources = config.getlist('general', "activated_modes") if "video" in activated_sources: video_dir = config.get('mediadb', 'video_directory') try: video_library = library.VideoLibrary(db,player,video_dir,fc) --- deejayd-0.7.2.orig/deejayd/webui/templates/playlist.xml +++ deejayd-0.7.2/deejayd/webui/templates/playlist.xml @@ -78,9 +78,10 @@ id="file-content" seltype="multiple" flex="1"/> - +