This commit is contained in:
Ad5001 2022-01-19 16:41:48 +01:00
commit 5e61869a78
Signed by: Ad5001
GPG key ID: 7251B1AF90B960F9
60 changed files with 174 additions and 84 deletions

25
CHANGELOG.md Normal file
View file

@ -0,0 +1,25 @@
# Changelog
## v0.1.3 (18 Jan 2022)
* Fixed bug: Confined packages (snapcraft & flatpak) won't show error messages related to update checks.
* FIxed bug: Equations of the form (x + y) / z were not being simplified properly.
-- Ad5001 <mail@ad5001.eu> Wed, 19 Jan 2022 20:00:00 +0100
## v0.1.2 (30 Sep 2021)
* Fixed bug: Unable to move Bode diagrams elements when having deleted the sum element.
* Fixed bug: Names were not not being changed from previous object when editing a new one.
* Fixed bug: Bode Magnitude was not drawn far enough
* Fixed bug: Bode Magnitude had undefined ending.
* Fixed other bugs from v0.1.1.
-- Ad5001 <mail@ad5001.eu> Mon, 30 Sep 2021 20:00:00 +0100
## v0.1 (26 Aug 2021)
* Initial release.
-- Ad5001 <mail@ad5001.eu> Mon, 06 Jun 2021 08:48:28 +0100

View file

@ -1,6 +1,6 @@
"""
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -17,7 +17,7 @@
"""
from shutil import which
__VERSION__ = "0.1.2"
__VERSION__ = "0.1.3"
is_release = False

View file

@ -1,6 +1,6 @@
"""
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
"""
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
"""
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
"""
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -85,7 +85,7 @@ D.Dialog {
wrapMode: Text.WordWrap
textFormat: Text.RichText
font.pixelSize: 13
text: "Copyright © 2021 Ad5001 &lt;mail@ad5001.eu&gt;<br>
text: "Copyright © 2022 Ad5001 &lt;mail@ad5001.eu&gt;<br>
<br>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.<br>
<br>

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,7 +1,7 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -135,16 +135,18 @@ class Function extends Common.ExecutableObject {
var previousY;
if(definitionDomain instanceof MathLib.SpecialDomain && definitionDomain.moveSupported) {
// Point based functions.
previousX = definitionDomain.previous(previousX)
previousX = definitionDomain.next(previousX)
if(previousX === null) previousX = definitionDomain.next(canvas.px2x(0))
previousY = expr.execute(previousX)
if(!drawPoints && !drawDash) return
while(previousX !== null && canvas.x2px(previousX) < canvas.canvasSize.width) {
var currentX = definitionDomain.next(previousX)
// Reconverted for canvas to fix for logarithmic scales.
var currentX = definitionDomain.next(canvas.px2x(canvas.x2px(previousX)+pxprecision));
var currentY = expr.execute(currentX)
if(currentX === null) break;
if((definitionDomain.includes(currentX) || definitionDomain.includes(previousX)) &&
(destinationDomain.includes(currentY) || destinationDomain.includes(previousY))) {
console.log(drawDash, drawPoints)
if(drawDash)
canvas.drawDashedLine(ctx, canvas.x2px(previousX), canvas.y2px(previousY), canvas.x2px(currentX), canvas.y2px(currentY))
if(drawPoints) {

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/**
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -134,7 +134,7 @@ function simplifyExpression(str) {
],
[ // Decomposition way 2
/(^.?|[+-] |\()\((([-.\d\w] [*/] )?[-\d\w.]+) ([+\-]) (([-.\d\w] [*/] )?[\d\w.+]+)\) ([*/]) ([-.\d\w]+)(.?$| [+-]|\))/g,
"$1$8 $7 $2 $4 $8 $7 $5$9"
"$1$2 $7 $8 $4 $5 $7 $8$9"
],
[ // Factorisation of π elements.
/(([-\d\w.]+ [*/] )*)(pi|π)(( [/*] [-\d\w.]+)*) ([+-]) (([-\d\w.]+ [*/] )*)(pi|π)(( [/*] [-\d\w.]+)*)?/g,
@ -199,7 +199,7 @@ function simplifyExpression(str) {
}
],
[// Starting & ending parenthesis if not needed.
/^\((.*)\)$/g,
/^\s*\((.*)\)\s*$/g,
function(match, middle) {
var str = middle
// Replace all groups

View file

@ -1,6 +1,6 @@
"""
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -19,6 +19,7 @@
from PySide2.QtCore import Qt, QRunnable, QThreadPool, QThread, QObject, Signal
from urllib.request import urlopen
from urllib.error import HTTPError, URLError
from sys import argv
class UpdateInformation(QObject):
got_update_info = Signal(bool, str, bool)
@ -67,7 +68,8 @@ def check_for_updates(current_version, window):
"""
Checks for updates in the background, and sends an alert with information.
"""
if "--no-check-for-updates" in argv:
return #
def cb(show_alert, msg_text, update_available):
pass
if show_alert:

View file

@ -1,5 +1,7 @@
# ![icon](https://git.ad5001.eu/Ad5001/LogarithmicPlotter/raw/branch/master/logplotter.svg) LogarithmPlotter
[![Build Status](https://ci.ad5001.eu/api/badges/Ad5001/LogarithmPlotter/status.svg)](https://ci.ad5001.eu/Ad5001/LogarithmicPlotter)
# ![icon](https://git.ad5001.eu/Ad5001/LogarithmPlotter/raw/branch/master/logplotter.svg) LogarithmPlotter
[![Build Status](https://ci.ad5001.eu/api/badges/Ad5001/LogarithmPlotter/status.svg)](https://ci.ad5001.eu/Ad5001/LogarithmPlotter)
[![On flathub](https://img.shields.io/flathub/v/eu.ad5001.LogarithmPlotter?label=on%20flathub)](https://flathub.org/apps/details/eu.ad5001.LogarithmPlotter)
[![On Snapcraft](https://badgen.net/snapcraft/v/logarithmplotter?label=on%20snapcraft)](https://snapcraft.io/logarithmplotter)
Create graphs with logarithm scales, namely BODE diagrams.

View file

@ -1,3 +1,10 @@
logarithmplotter (0.1.3) stable; urgency=medium
* Fixed bug: Confined packages (snapcraft & flatpak) won't show error messages related to update checks.
* FIxed bug: Equations of the form (x + y) / z were not being simplified properly.
-- Ad5001 <mail@ad5001.eu> Wed, 19 Jan 2022 20:00:00 +0100
logarithmplotter (0.1.2) unstable; urgency=medium
* Fixed bug: Unable to move Bode diagrams elements when having deleted the sum element.
@ -6,10 +13,10 @@ logarithmplotter (0.1.2) unstable; urgency=medium
* Fixed bug: Bode Magnitude had undefined ending.
* Fixed other bugs from v0.1.1.
-- Ad5001 <mail@ad5001.eu> Mon, 30 Sep 2021 20:00:00 +0200
-- Ad5001 <mail@ad5001.eu> Mon, 30 Sep 2021 20:00:00 +0100
logarithmplotter (0.1.dev0) UNRELEASED; urgency=medium
logarithmplotter (0.1) UNRELEASED; urgency=medium
* Initial release.
-- Ad5001 <mail@ad5001.eu> Mon, 06 Jun 2021 08:48:28 +0200
-- Ad5001 <mail@ad5001.eu> Thu, 26 Aug 2021 08:48:28 +0100

View file

@ -1 +0,0 @@
11

View file

@ -1 +0,0 @@
logarithmplotter usr/bin/

View file

@ -30,8 +30,8 @@
</description>
<categories>
<category>Network</category>
<category>Feed</category>
<category>Science</category>
<category>Education</category>
</categories>
<url type="homepage">https://apps.ad5001.eu/logarithmplotter/</url>
<url type="bugtracker">https://git.ad5001.eu/Ad5001/LogarithmPlotter/issues/</url>
@ -42,9 +42,12 @@
</screenshots>
<releases>
<release version="0.1" date="2021-08-15"/>
<release version="0.1.2" date="2021-09-30"/>
<release version="0.1.3" date="2022-01-19"/>
</releases>
<content_rating type="oars-1.0">
</content_rating>
<developer_name>Ad5001</developer_name>
<update_contact>mail@ad5001.eu</update_contact>
</application>

View file

@ -30,8 +30,8 @@
</description>
<categories>
<category>Network</category>
<category>Feed</category>
<category>Science</category>
<category>Education</category>
</categories>
<url type="homepage">https://apps.ad5001.eu/logarithmplotter/</url>
<url type="bugtracker">https://git.ad5001.eu/Ad5001/LogarithmPlotter/issues/</url>
@ -42,9 +42,12 @@
</screenshots>
<releases>
<release version="0.1" date="2021-08-15"/>
<release version="0.1.2" date="2021-09-30"/>
<release version="0.1.3" date="2022-01-19"/>
</releases>
<content_rating type="oars-1.0">
</content_rating>
<developer_name>Ad5001</developer_name>
<update_contact>mail@ad5001.eu</update_contact>
</application>

View file

@ -23,12 +23,12 @@
],
"modules": [
"python3-pyside2.json",
{
"name": "LogarithmPlotter",
"buildsystem": "simple",
"config-opts": ["no-debuginfo-compression"],
"build-commands": [
"rm -rf .git",
"PREFIX=\"/app/share\" FLATPAK_INSTALL=1 python3 setup.py install --prefix=/app"
],
"sources": [

View file

@ -1,7 +1,7 @@
#!/bin/bash
#
# AccountFree - Browse and use online services, free of account.
# Copyright (C) 2021 Ad5001 <mail@ad5001.eu>
# Copyright (C) 2022 Ad5001 <mail@ad5001.eu>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

24
linux/sign-deb.sh Executable file
View file

@ -0,0 +1,24 @@
#!/bin/bash
# This script is used to sign the LogarithmPlotter deb directly from it's DSC file.
# Adapted from https://github.com/astraw/stdeb/issues/181
PPA_ARCHIVE="ppa:ad5001/logarithmplotter"
cd ../deb_dist
# create a temporary folder
mkdir tmp -p
cd tmp
rm -rf *
# DSC file variables
dsc_file="$(find ../ -regextype sed -regex ".*/*\-ppa[0-9]*.dsc" | cut -c 4-)"
source_package_name="$(echo $dsc_file | cut -c -$(expr ${#dsc_file} - 4))"
# extract and sign the files
dpkg-source -x "../$dsc_file"
cd "$(find . -type d | head -n 2 | tail -n 1 | cut -c 3-)" # go to the (only) directory.
debuild -S -sa -k"mail@ad5001.eu"
# upload package to my PPA
dput $PPA_ARCHIVE "../${source_package_name}_source.changes"

View file

@ -11,4 +11,4 @@ set \
#export QT_QPA_PLATFORMTHEME=kde
# Finally run the next part of the command chain
exec "${@}"
exec "${@} --no-check-for-updates"

View file

@ -1,6 +1,8 @@
#!/bin/bash
python3 setup.py --command-packages=stdeb.command sdist_dsc --package logarithmplotter --copyright-file linux/debian/copyright --suite hirsute --recommends "$(cat linux/debian/recommends)" --depends "$(cat linux/debian/depends)" --section science bdist_deb
python3 setup.py --remove-git-version --command-packages=stdeb.command sdist_dsc \
--package logarithmplotter --copyright-file linux/debian/copyright --suite sid --depends3 "$(cat linux/debian/depends)" --section science \
--debian-version "ppa1" bdist_deb
# Flatpak building
FLATPAK_BUILDER=$(which flatpak-builder)

View file

@ -1,6 +1,6 @@
"""
* LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001
* Copyright (C) 2022 Ad5001
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -20,23 +20,35 @@ import setuptools
import os
import sys
print(sys.argv)
current_dir = os.path.realpath(os.path.dirname(os.path.realpath(__file__)))
if "PREFIX" not in os.environ and sys.platform == 'linux':
if "XDG_DATA_HOME" in os.environ:
os.environ["PREFIX"] = os.environ["XDG_DATA_HOME"]
else :
try:
# Checking if we have permission to write to root.
from os import makedirs, rmdir
makedirs("/usr/share/applications/test")
rmdir("/usr/share/applications/test")
os.environ["PREFIX"] = "/usr/share"
except:
os.environ["PREFIX"] = os.environ["HOME"] + "/.local/share"
from getopt import getopt
optlist, args = getopt(sys.argv, '', ['prefix=', 'root='])
for arg,value in optlist:
if arg == "prefix":
os.environ["PREFIX"] = value
if "PREFIX" not in os.environ and sys.platform == 'linux':
if "XDG_DATA_HOME" in os.environ:
os.environ["PREFIX"] = os.environ["XDG_DATA_HOME"]
else:
try:
# Checking if we have permission to write to root.
from os import makedirs, rmdir
makedirs("/usr/share/applications/test")
rmdir("/usr/share/applications/test")
os.environ["PREFIX"] = "/usr/share"
except:
os.environ["PREFIX"] = os.environ["HOME"] + "/.local/share"
from LogarithmPlotter import __VERSION__ as pkg_version
if "--remove-git-version" in sys.argv:
pkg_version = pkg_version.split(".dev0")[0]
sys.argv.remove("--remove-git-version")
CLASSIFIERS = """
Environment :: Graphic
Environment :: X11 Applications :: Qt
@ -70,6 +82,10 @@ def package_data():
data_files = []
if sys.platform == 'linux':
data_files.append(('share/applications/', ['linux/logarithmplotter.desktop']))
data_files.append(('share/mime/packages/', ['linux/x-logarithm-plot.xml']))
data_files.append(('share/icons/hicolor/scalable/mimetypes/', ['linux/application-x-logarithm-plot.svg']))
data_files.append(('share/icons/hicolor/scalable/apps/', ['logplotter.svg']))
data_files.append((os.environ["PREFIX"] + '/applications/', ['linux/logarithmplotter.desktop']))
data_files.append((os.environ["PREFIX"] + '/mime/packages/', ['linux/x-logarithm-plot.xml']))
data_files.append((os.environ["PREFIX"] + '/icons/hicolor/scalable/mimetypes/', ['linux/application-x-logarithm-plot.svg']))
@ -82,7 +98,6 @@ if sys.platform == 'linux':
os.makedirs(os.environ["PREFIX"] + '/icons/hicolor/scalable/mimetypes/', exist_ok=True)
os.makedirs(os.environ["PREFIX"] + '/icons/hicolor/scalable/apps/', exist_ok=True)
os.makedirs(os.environ["PREFIX"] + '/metainfo/', exist_ok=True)
copyfile(current_dir + '/linux/logarithmplotter.desktop', os.environ["PREFIX"] + '/applications/logarithmplotter.desktop')
copyfile(current_dir + '/linux/x-logarithm-plot.xml', os.environ["PREFIX"] + '/mime/packages/x-logarithm-plot.xml')
copyfile(current_dir + '/linux/application-x-logarithm-plot.svg',
os.environ["PREFIX"] + '/icons/hicolor/scalable/mimetypes/application-x-logarithm-plot.svg')
@ -90,6 +105,13 @@ if sys.platform == 'linux':
if "FLATPAK_INSTALL" in os.environ:
copyfile(current_dir + '/linux/eu.ad5001.LogarithmPlotter.metainfo.flatpak.xml',
os.environ["PREFIX"] + '/metainfo/eu.ad5001.LogarithmPlotter.metainfo.xml')
copyfile(current_dir + '/linux/flatpak/logarithmplotter.desktop',
os.environ["PREFIX"] + '/applications/logarithmplotter.desktop')
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')
elif sys.argv[1] == "uninstall":
os.remove(os.environ["PREFIX"] + '/applications/logarithmplotter.desktop')
os.remove(os.environ["PREFIX"] + '/mime/packages/x-logarithm-plot.xml')
@ -103,7 +125,7 @@ setuptools.setup(
name='logarithmplotter',
version=pkg_version,
description='Browse and use online services, free of account',
description='Create graphs with logarithm scales.',
long_description=read_file("README.md"),
keywords='logarithm plotter graph creator bode diagram',
@ -111,7 +133,7 @@ setuptools.setup(
author_email='mail@ad5001.eu',
license=('GPLv3'),
url='https://apps.ad5001.eu/logarithmplotter',
url='https://apps.ad5001.eu/logarithmplotter/',
classifiers=CLASSIFIERS,
zip_safe=False,

View file

@ -1,6 +1,6 @@
name: logarithmplotter
title: LogarithmPlotter
version: '0.1.2'
version: '0.1.3'
summary: 2D plotter software to make BODE plots, sequences and repartition functions.
description: |
LogarithmPlotter is, as it's name suggests, a plotter made with logarithm scales in mind. With an object system similar to [Geogebra](https://geogebra.org)'s, it allows dynamic creation of plots with very few limitations.

View file

@ -157,7 +157,7 @@ Section ""
File *.dll
File *.pyd
File *.md
File *.manifest
;File *.manifest
File *.zip
File *.bmp
File *.ico