22# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
33### BEGIN LICENSE
44# Copyright (C) 2012, Wolf Vollprecht <w.vollprecht@gmail.com>
5- # This program is free software: you can redistribute it and/or modify it
6- # under the terms of the GNU General Public License version 3, as published
5+ # This program is free software: you can redistribute it and/or modify it
6+ # under the terms of the GNU General Public License version 3, as published
77# by the Free Software Foundation.
8- #
9- # This program is distributed in the hope that it will be useful, but
10- # WITHOUT ANY WARRANTY; without even the implied warranties of
11- # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
8+ #
9+ # This program is distributed in the hope that it will be useful, but
10+ # WITHOUT ANY WARRANTY; without even the implied warranties of
11+ # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
1212# PURPOSE. See the GNU General Public License for more details.
13- #
14- # You should have received a copy of the GNU General Public License along
13+ #
14+ # You should have received a copy of the GNU General Public License along
1515# with this program. If not, see <http://www.gnu.org/licenses/>.
1616### END LICENSE
1717
2222from setuptools import setup
2323import os
2424
25- def package_files (directory ):
26- paths = []
27- for (path , directories , filenames ) in os .walk (directory ):
25+ def data_files (basename ):
26+ data = os .path .join ('.' , 'data' )
27+ root = os .path .join (data , basename )
28+ extra_files = []
29+ for path , directories , filenames in os .walk (root ):
30+ paths = []
2831 for filename in filenames :
2932 paths .append (os .path .join (path , filename ))
30- return paths
33+ extra_files .append (('share/uberwriter/data/{}' .format (os .path .relpath (path , data )), paths ))
34+ return extra_files
3135
32- extra_files_ui = package_files ('./data/ui' )
33- extra_files_media_css = package_files ('./data/media/css' )
34- extra_files_media_fonts = package_files ('./data/media/fonts' )
35- extra_files_scripts = package_files ('./data/lua' )
36- from pprint import pprint
37- pprint (extra_files_ui )
38- pprint (extra_files_media_css )
39- pprint (extra_files_media_fonts )
40-
41- if os .path .isfile ("/.flatpak-info" ):
42- app_prefix = '/app/'
43- else :
44- app_prefix = '/usr/'
36+ extra_files_ui = data_files ('ui' )
37+ extra_files_media = data_files ('media' )
38+ extra_files_scripts = data_files ('lua' )
4539
4640setup (
4741 name = 'uberwriter' ,
@@ -51,10 +45,10 @@ def package_files(directory):
5145 author_email = 'w.vollprecht@gmail.com' ,
5246 description = 'A beautiful, simple and distraction free markdown editor.' ,
5347 long_description = """UberWriter, beautiful distraction free writing
54- With UberWriter you get only one thing: An empty textbox, that is to
55- fill with your ideas. There are no settings, you don't have to choose a
56- font, it is only for writing.You can use markdown for all your markup
57- needs. PDF, RTF and HTML are generated with pandoc. For PDF generation it
48+ With UberWriter you get only one thing: An empty textbox, that is to
49+ fill with your ideas. There are no settings, you don't have to choose a
50+ font, it is only for writing.You can use markdown for all your markup
51+ needs. PDF, RTF and HTML are generated with pandoc. For PDF generation it
5852 is also required that you choose to install the texlive-luatex package.""" ,
5953 url = 'https://github.com/wolfv/uberwriter/' ,
6054 # cmdclass={'install': InstallAndUpdateDataDirectory},
@@ -76,15 +70,12 @@ def package_files(directory):
7670 'uberwriter.pylocales' : ['locales.db' ],
7771 },
7872 data_files = [
79- (app_prefix + 'bin' , ['bin/uberwriter' ]),
80- (app_prefix + 'share/glib-2.0/schemas' , ['data/de.wolfvollprecht.UberWriter.gschema.xml' ]),
81- (app_prefix + 'share/icons/hicolor/scalable/apps' , ['data/media/de.wolfvollprecht.UberWriter.svg' ]),
82- (app_prefix + 'share/icons/hicolor/symbolic/apps' , ['data/media/de.wolfvollprecht.UberWriter-symbolic.svg' ]),
83- (app_prefix + 'share/applications' , ['data/de.wolfvollprecht.UberWriter.desktop' ]),
84- (app_prefix + 'share/uberwriter/data/media' , ['data/media/uberwriter_markdown.md' ]),
85- (app_prefix + 'share/uberwriter/data/ui' , extra_files_ui ),
86- (app_prefix + 'share/uberwriter/data/media/css' , extra_files_media_css ),
87- (app_prefix + 'share/uberwriter/data/media/fonts' , extra_files_media_fonts ),
88- (app_prefix + 'share/uberwriter/data/lua' , extra_files_scripts )
73+ ('bin' , ['uberwriter.in' ]),
74+ ('share/applications' , ['data/de.wolfvollprecht.UberWriter.desktop' ]),
75+ ('share/metainfo' , ['data/de.wolfvollprecht.UberWriter.appdata.xml' ]),
76+ ('share/icons/hicolor/scalable/apps' , ['data/media/de.wolfvollprecht.UberWriter.svg' ]),
77+ ('share/icons/hicolor/symbolic/apps' , ['data/media/de.wolfvollprecht.UberWriter-symbolic.svg' ]),
78+ ('share/glib-2.0/schemas' , ['data/de.wolfvollprecht.UberWriter.gschema.xml' ]),
79+ * (extra_files_ui + extra_files_media + extra_files_scripts )
8980 ]
9081)
0 commit comments