2021-06-21 22:27:40 +00:00
|
|
|
"""
|
2022-01-20 17:19:36 +00:00
|
|
|
* LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions.
|
2022-01-12 13:39:23 +00:00
|
|
|
* Copyright (C) 2022 Ad5001
|
2021-06-21 22:27:40 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
"""
|
2021-08-14 14:13:14 +00:00
|
|
|
from shutil import which
|
2021-06-21 22:27:40 +00:00
|
|
|
|
2022-01-26 18:40:19 +00:00
|
|
|
__VERSION__ = "0.1.6"
|
2022-01-24 20:56:52 +00:00
|
|
|
is_release = False
|
2021-08-14 14:13:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Check if development version, if so get the date of the latest git patch
|
|
|
|
# and append it to the version string.
|
2022-01-24 17:27:16 +00:00
|
|
|
if not is_release and which('git') is not None:
|
2021-08-14 14:13:14 +00:00
|
|
|
from os.path import realpath, join, dirname, exists
|
|
|
|
from subprocess import check_output
|
|
|
|
from datetime import datetime
|
|
|
|
# Command to check date of latest git commit
|
|
|
|
cmd = ['git', 'log', '--format=%ci', '-n 1']
|
|
|
|
cwd = realpath(join(dirname(__file__), '..')) # Root AccountFree directory.
|
|
|
|
if exists(join(cwd, '.git')):
|
|
|
|
date_str = check_output(cmd, cwd=cwd).decode('utf-8').split(' ')[0]
|
|
|
|
try:
|
|
|
|
date = datetime.fromisoformat(date_str)
|
|
|
|
__VERSION__ += '.dev0+git' + date.strftime('%Y%m%d')
|
|
|
|
except ValueError:
|
|
|
|
# Date cannot be parsed, not git root?
|
|
|
|
pass
|
2021-06-21 22:27:40 +00:00
|
|
|
|
2021-06-21 23:33:42 +00:00
|
|
|
if __name__ == "__main__":
|
2021-07-30 23:40:51 +00:00
|
|
|
from .logarithmplotter import run
|
2021-06-21 23:33:42 +00:00
|
|
|
run()
|