Browse Source

Fixing deb building, putting changelog into cache for env without internet (e.g flatpak).

master
Ad5001 5 months ago
parent
commit
d0fb6e9a3a
Signed by: Ad5001
GPG Key ID: EF45F9C6AFE20160
  1. 12
      LogarithmPlotter/helper.py
  2. 1
      MANIFEST.in
  3. 11
      setup.py

12
LogarithmPlotter/helper.py

@ -145,6 +145,14 @@ class Helper(QObject):
@Slot()
def fetchChangelog(self):
runnable = ChangelogFetcher(self)
QThreadPool.globalInstance().start(runnable)
changelog_cache_path = path.join(path.dirname(path.realpath(__file__), "CHANGELOG.md"))
if path.exists(changelog_cache_path):
# We have a cached version of the changelog, for env that don't have access to the internet.
f = open(changelog_cache_path);
self.changelogFetched.emit("".join(f.readlines()).strip())
f.close()
else:
# Fetch it from the internet.
runnable = ChangelogFetcher(self)
^QThreadPool.globalInstance().start(runnable)

1
MANIFEST.in

@ -2,4 +2,5 @@
recursive-include LogarithmPlotter/qml *.qml *.js *.qdoc qmldir *.svg *.md LICENSE
recursive-include LogarithmPlotter/i18n *.qm *.ts
include LogarithmPlotter/ *.svg
include LogarithmPlotter/ *.md

11
setup.py

@ -19,6 +19,7 @@
import setuptools
import os
import sys
from shutil import copyfile
print(sys.argv)
@ -41,7 +42,10 @@ if "PREFIX" not in os.environ and sys.platform == 'linux':
rmdir("/usr/share/applications/test")
os.environ["PREFIX"] = "/usr/share"
except:
os.environ["PREFIX"] = os.environ["HOME"] + "/.local/share"
if ".pybuild" in os.environ["HOME"]: # Launchpad building.
os.environ["PREFIX"] = "/usr/share"
else:
os.environ["PREFIX"] = os.environ["HOME"] + "/.local/share"
from LogarithmPlotter import __VERSION__ as pkg_version
@ -81,6 +85,7 @@ def package_data():
for d,folders,files in os.walk("LogarithmPlotter/i18n"):
d = d[17:]
pkg_data += [os.path.join(d, f) for f in files]
return pkg_data
data_files = []
@ -95,7 +100,6 @@ if sys.platform == 'linux':
data_files.append((os.environ["PREFIX"] + '/icons/hicolor/scalable/apps/', ['logplotter.svg']))
if len(sys.argv) > 1:
if sys.argv[1] == "install":
from shutil import copyfile
os.makedirs(os.environ["PREFIX"] + '/applications/', exist_ok=True)
os.makedirs(os.environ["PREFIX"] + '/mime/packages/', exist_ok=True)
os.makedirs(os.environ["PREFIX"] + '/icons/hicolor/scalable/mimetypes/', exist_ok=True)
@ -113,8 +117,7 @@ if sys.platform == 'linux':
else:
copyfile(current_dir + '/linux/eu.ad5001.LogarithmPlotter.metainfo.xml',
os.environ["PREFIX"] + '/metainfo/eu.ad5001.LogarithmPlotter.metainfo.xml')
copyfile(current_dir + '/linux/logarithmplotter.desktop',
os.environ["PREFIX"] + '/applications/logarithmplotter.desktop')
#copyfile(current_dir + '/linux/logarithmplotter.desktop', os.environ["PREFIX"] + '/applications/logarithmplotter.desktop')
elif sys.argv[1] == "uninstall":
os.remove(os.environ["PREFIX"] + '/applications/logarithmplotter.desktop')
os.remove(os.environ["PREFIX"] + '/mime/packages/x-logarithm-plot.xml')

Loading…
Cancel
Save