| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,6 +16,6 @@ jobs: | |||
| 16 | 16 | with: | |
| 17 | 17 | project: diffpy.pdfgui | |
| 18 | 18 | c_extension: false | |
| 19 | - headless: false | ||
| 19 | + headless: true | ||
| 20 | 20 | secrets: | |
| 21 | 21 | CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,6 +10,6 @@ jobs: | |||
| 10 | 10 | with: | |
| 11 | 11 | project: diffpy.pdfgui | |
| 12 | 12 | c_extension: false | |
| 13 | - headless: false | ||
| 13 | + headless: true | ||
| 14 | 14 | secrets: | |
| 15 | 15 | CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,23 @@ | |||
| 1 | + **Added:** | ||
| 2 | + | ||
| 3 | + * No News Added: fix gui functionality after skpkg | ||
| 4 | + | ||
| 5 | + **Changed:** | ||
| 6 | + | ||
| 7 | + * <news item> | ||
| 8 | + | ||
| 9 | + **Deprecated:** | ||
| 10 | + | ||
| 11 | + * <news item> | ||
| 12 | + | ||
| 13 | + **Removed:** | ||
| 14 | + | ||
| 15 | + * <news item> | ||
| 16 | + | ||
| 17 | + **Fixed:** | ||
| 18 | + | ||
| 19 | + * <news item> | ||
| 20 | + | ||
| 21 | + **Security:** | ||
| 22 | + | ||
| 23 | + * <news item> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -49,7 +49,7 @@ exclude = [] # exclude packages matching these glob patterns (empty by default) | |||
| 49 | 49 | namespaces = false # to disable scanning PEP 420 namespaces (true by default) | |
| 50 | 50 | ||
| 51 | 51 | [project.scripts] | |
| 52 | - diffpy-pdfgui = "diffpy.pdfgui.app:main" | ||
| 52 | + pdfgui = "diffpy.pdfgui.applications.pdfgui:main" | ||
| 53 | 53 | ||
| 54 | 54 | [tool.setuptools.dynamic] | |
| 55 | 55 | dependencies = {file = ["requirements/pip.txt"]} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,12 +16,15 @@ | |||
| 16 | 16 | ############################################################################## | |
| 17 | 17 | ||
| 18 | 18 | import random | |
| 19 | + from datetime import datetime, timezone | ||
| 19 | 20 | ||
| 20 | 21 | import wx | |
| 21 | 22 | import wx.lib.agw.hyperlink | |
| 22 | 23 | ||
| 23 | 24 | from diffpy.pdfgui.gui.pdfguiglobals import iconpath | |
| 24 | - from diffpy.pdfgui.version import __date__, __version__ | ||
| 25 | + from diffpy.pdfgui.version import __version__ | ||
| 26 | + | ||
| 27 | + __date__ = datetime.now(timezone.utc).date().isoformat() | ||
| 25 | 28 | ||
| 26 | 29 | _acknowledgement = """\ | |
| 27 | 30 | This software was developed by the Billinge-group as part of the Distributed | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,8 +14,8 @@ | |||
| 14 | 14 | ############################################################################## | |
| 15 | 15 | """This module contains global parameters needed by PDFgui.""" | |
| 16 | 16 | ||
| 17 | - import os.path | ||
| 18 | 17 | from importlib.resources import files | |
| 18 | + from pathlib import Path | ||
| 19 | 19 | ||
| 20 | 20 | from diffpy.pdfgui.gui import debugoptions | |
| 21 | 21 | ||
@@ -24,34 +24,24 @@ | |||
| 24 | 24 | # Maximum number of files to be remembered | |
| 25 | 25 | MAXMRU = 5 | |
| 26 | 26 | # The location of the configuration file | |
| 27 | - configfilename = os.path.expanduser("~/.pdfgui_py3.cfg") | ||
| 27 | + configfilename = Path.home() / ".pdfgui_py3.cfg" | ||
| 28 | 28 | # Project modification flag | |
| 29 | 29 | isAltered = False | |
| 30 | 30 | ||
| 31 | - # Resolve APPDATADIR base path to application data files. | ||
| 32 | - try: | ||
| 33 | - _mydir = os.path.abspath(str(files(__name__))) | ||
| 34 | - except TypeError: # For Python < 3.12 | ||
| 35 | - _mydir = os.path.abspath(os.path.dirname(__file__)) | ||
| 31 | + _mydir = Path(str(files(__name__))).resolve() | ||
| 36 | 32 | ||
| 37 | - _upbasedir = os.path.normpath(_mydir + "/../../..") | ||
| 38 | - _development_mode = os.path.basename(_upbasedir) == "src" and os.path.isfile( | ||
| 39 | - os.path.join(_upbasedir, "../pyproject.toml") | ||
| 40 | - ) | ||
| 33 | + _upbasedir = _mydir.parents[2] | ||
| 34 | + _development_mode = _upbasedir.name == "src" and (_upbasedir.parent / "pyproject.toml").is_file() | ||
| 41 | 35 | ||
| 42 | 36 | # Requirement must have egg-info. Do not use in _development_mode. | |
| 43 | 37 | _req = "diffpy.pdfgui" | |
| 44 | 38 | ||
| 45 | - # pavol | ||
| 46 | - # APPDATADIR = (os.path.dirname(_upbasedir) if _development_mode | ||
| 47 | - # else str(files(_req))) | ||
| 48 | - # long | ||
| 49 | 39 | if _development_mode: | |
| 50 | - APPDATADIR = os.path.dirname(_mydir) | ||
| 40 | + APPDATADIR = _mydir.parent | ||
| 51 | 41 | else: | |
| 52 | - APPDATADIR = str(files(_req)) | ||
| 42 | + APPDATADIR = Path(str(files(_req))).resolve() | ||
| 53 | 43 | ||
| 54 | - APPDATADIR = os.path.abspath(APPDATADIR) | ||
| 44 | + APPDATADIR = APPDATADIR.resolve() | ||
| 55 | 45 | ||
| 56 | 46 | # Location of the HTML manual | |
| 57 | 47 | docMainFile = "https://diffpy.github.io/diffpy.pdfgui/manual.html" | |
@@ -62,24 +52,31 @@ | |||
| 62 | 52 | ||
| 63 | 53 | ||
| 64 | 54 | def iconpath(iconfilename): | |
| 65 | - """Full path to the icon file in pdfgui installation. This function | ||
| 66 | - should be used whenever GUI needs access to custom icons. | ||
| 55 | + """Full path to the icon file in pdfgui installation. | ||
| 67 | 56 | ||
| 68 | - iconfilename -- icon file name without any path | ||
| 57 | + This function should be used whenever GUI needs access to custom | ||
| 58 | + icons. | ||
| 69 | 59 | ||
| 70 | - Return string. | ||
| 60 | + Parameters | ||
| 61 | + ---------- | ||
| 62 | + iconfilename : str | ||
| 63 | + The icon file name without any path. | ||
| 64 | + | ||
| 65 | + Returns | ||
| 66 | + ------- | ||
| 67 | + str | ||
| 68 | + The full path to the icon file. | ||
| 71 | 69 | """ | |
| 72 | - rv = os.path.join(APPDATADIR, "icons", iconfilename) | ||
| 73 | - assert os.path.isfile(rv), "icon file does not exist" | ||
| 74 | - return rv | ||
| 70 | + rv = APPDATADIR / "icons" / iconfilename | ||
| 71 | + assert rv.is_file(), "icon file does not exist" | ||
| 72 | + return str(rv) | ||
| 75 | 73 | ||
| 76 | 74 | ||
| 77 | 75 | # options and arguments passed on command line | |
| 78 | 76 | cmdopts = [] | |
| 79 | 77 | cmdargs = [] | |
| 80 | 78 | ||
| 81 | 79 | # debugging options: | |
| 82 | - | ||
| 83 | 80 | dbopts = debugoptions.DebugOptions() | |
| 84 | 81 | ||
| 85 | 82 | # End of file | |
| Back | FazBrowse Home | New Git URL |
0 commit comments