"Fossies" - the Fresh Open Source Software Archive

Member "PhotoCollage-1.4.5/setup.py" (9 Jul 2021, 4840 Bytes) of package /linux/privat/PhotoCollage-1.4.5.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "setup.py" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.4.4_vs_1.4.5.

    1 #!/usr/bin/env python
    2 # Copyright (C) 2013 Adrien Vergé
    3 #
    4 # This program is free software; you can redistribute it and/or modify
    5 # it under the terms of the GNU General Public License as published by
    6 # the Free Software Foundation; either version 2 of the License, or
    7 # (at your option) any later version.
    8 #
    9 # This program is distributed in the hope that it will be useful,
   10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
   11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12 # GNU General Public License for more details.
   13 #
   14 # You should have received a copy of the GNU General Public License along
   15 # with this program; if not, write to the Free Software Foundation, Inc.,
   16 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
   17 
   18 import distutils
   19 import distutils.command.build
   20 import distutils.core
   21 import os
   22 
   23 from photocollage import APP_NAME, APP_VERSION
   24 
   25 
   26 class build_i18n(distutils.core.Command):
   27     def initialize_options(self):
   28         pass
   29 
   30     def finalize_options(self):
   31         pass
   32 
   33     def run(self):
   34         if not distutils.spawn.find_executable("msgfmt"):
   35             raise Exception("GNU gettext msgfmt utility not found! "
   36                             "It is needed to compile po files.")
   37 
   38         for file in os.listdir("po"):
   39             if not file.endswith(".po"):
   40                 continue
   41 
   42             lang = file[:-3]
   43 
   44             po = os.path.join("po", file)
   45             dir = os.path.join("build", "mo", lang, "LC_MESSAGES")
   46             self.mkpath(dir)
   47             mo = os.path.join(dir, "%s.mo" % self.distribution.metadata.name)
   48 
   49             if distutils.dep_util.newer(po, mo):
   50                 distutils.log.info("Compile: {} -> {}".format(po, mo))
   51                 self.spawn(["msgfmt", "-o", mo, po])
   52 
   53             targetpath = os.path.join("share", "locale", lang, "LC_MESSAGES")
   54             self.distribution.data_files.append((targetpath, (mo,)))
   55 
   56 
   57 distutils.command.build.build.sub_commands.append(("build_i18n", None))
   58 
   59 
   60 long_description = (
   61     "PhotoCollage allows you to create photo collage posters. It assembles "
   62     "the input photographs it is given to generate a big poster. Photos are "
   63     "automatically arranged to fill the whole poster, then you can change the "
   64     "final layout, dimensions, border or swap photos in the generated grid. "
   65     "Eventually the final poster image can be saved in any size.")
   66 
   67 distutils.core.setup(
   68     name=APP_NAME,
   69     version=APP_VERSION,
   70     author="Adrien Vergé",
   71     author_email="adrienverge@gmail.com",
   72     url="https://github.com/adrienverge/PhotoCollage",
   73     description="Graphical tool to make photo collage posters",
   74     long_description=long_description,
   75     license="GPLv2+",
   76     platforms=["linux"],
   77 
   78     classifiers=[
   79         "Development Status :: 5 - Production/Stable",
   80         "Environment :: X11 Applications :: GTK",
   81         "Intended Audience :: End Users/Desktop",
   82         "License :: OSI Approved"
   83         " :: GNU General Public License v2 or later (GPLv2+)",
   84         "Operating System :: POSIX",
   85         "Programming Language :: Python",
   86         "Programming Language :: Python :: 3",
   87         "Programming Language :: Python :: 3.5",
   88         "Programming Language :: Python :: 3.6",
   89         "Programming Language :: Python :: 3.7",
   90         "Programming Language :: Python :: 3.8",
   91         "Programming Language :: Python :: 3 :: Only",
   92         "Topic :: Multimedia :: Graphics",
   93     ],
   94 
   95     packages=["photocollage"],
   96     scripts=["bin/photocollage"],
   97     data_files=[
   98         ("share/applications", ["data/photocollage.desktop"]),
   99         ("share/appdata", ["data/photocollage.appdata.xml"]),
  100         ("share/icons/hicolor/scalable/apps",
  101          ["data/icons/hicolor/scalable/apps/photocollage.svg"]),
  102         ("share/icons/hicolor/16x16/apps",
  103          ["data/icons/hicolor/16x16/apps/photocollage.png"]),
  104         ("share/icons/hicolor/22x22/apps",
  105          ["data/icons/hicolor/22x22/apps/photocollage.png"]),
  106         ("share/icons/hicolor/24x24/apps",
  107          ["data/icons/hicolor/24x24/apps/photocollage.png"]),
  108         ("share/icons/hicolor/32x32/apps",
  109          ["data/icons/hicolor/32x32/apps/photocollage.png"]),
  110         ("share/icons/hicolor/48x48/apps",
  111          ["data/icons/hicolor/48x48/apps/photocollage.png"]),
  112         ("share/icons/hicolor/64x64/apps",
  113          ["data/icons/hicolor/64x64/apps/photocollage.png"]),
  114         ("share/icons/hicolor/128x128/apps",
  115          ["data/icons/hicolor/128x128/apps/photocollage.png"]),
  116         ("share/icons/hicolor/256x256/apps",
  117          ["data/icons/hicolor/256x256/apps/photocollage.png"]),
  118     ],
  119 
  120     cmdclass={
  121         "build_i18n": build_i18n,
  122     },
  123 
  124     requires=[
  125         "Pillow",
  126         "pycairo",
  127         # Also requires PyGI (the Python GObject Introspection bindings), which
  128         # is not packaged on pypi.
  129     ],
  130 )