[med-svn] [Git][med-team/pycorrfit][upstream] New upstream version 1.1.7+dfsg
Steffen Möller
gitlab at salsa.debian.org
Wed Dec 4 13:29:49 GMT 2019
Steffen Möller pushed to branch upstream at Debian Med / pycorrfit
Commits:
01662a34 by Steffen Moeller at 2019-12-04T13:18:23Z
New upstream version 1.1.7+dfsg
- - - - -
10 changed files:
- + .github/FUNDING.yml
- CHANGELOG
- docs/conf.py
- + docs/extensions/simple_gallery.py
- docs/requirements.txt
- docs/sec_contribute.rst
- docs/sec_gallery.rst
- + pycorrfit/gui/contribute.py
- pycorrfit/gui/doc.py
- pycorrfit/gui/frontend.py
Changes:
=====================================
.github/FUNDING.yml
=====================================
@@ -0,0 +1,2 @@
+github: paulmueller
+liberapay: paulmueller
=====================================
CHANGELOG
=====================================
@@ -1,3 +1,6 @@
+1.1.7
+ - docs: add sponsor links to contribute section
+ - docs: add gallery with all images in docs/gallery
1.1.6
- fix: improve support for Confocor FCS file format
(see discussion in #37)
=====================================
docs/conf.py
=====================================
@@ -65,6 +65,7 @@ extensions = ['sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
'github_changelog',
+ 'simple_gallery',
]
# Add any paths that contain templates here, relative to this directory.
@@ -119,7 +120,7 @@ todo_include_todos = False
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
-html_theme = 'default'
+html_theme = 'sphinx_rtd_theme'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
=====================================
docs/extensions/simple_gallery.py
=====================================
@@ -0,0 +1,63 @@
+"""Show all images in the "gallery" folder
+
+Usage:
+
+ .. simple_gallery::
+ :dir: gallery
+
+where "gallery" is relative to the folder containing conf.py.
+
+Changelog:
+0.1 (2019-10-24)
+ - initial release
+"""
+import pathlib
+
+from docutils.statemachine import ViewList
+from docutils.parsers.rst import Directive, directives
+from sphinx.util.nodes import nested_parse_with_titles
+from docutils import nodes
+
+
+class SimpleGalleryDirective(Directive):
+ required_arguments = 0
+ optional_arguments = 1
+ final_argument_whitespace = True
+
+ option_spec = {
+ 'dir': directives.unchanged,
+ }
+
+ def get_files(self):
+ """This will return a list of files"""
+ root = pathlib.Path(__file__).parent.parent
+ gpath = root / self.options["dir"]
+ files = []
+ for ff in gpath.glob("*"):
+ if ff.suffix in [".png", "*.jpg"]:
+ files.append(ff.relative_to(root))
+ return files
+
+ def run(self):
+ rst = []
+ files = self.get_files()
+
+ for ff in files:
+ rst.append(".. image:: {}".format(ff))
+ rst.append(" :target: _images/{}".format(ff.name))
+ rst.append(" :scale: 25%")
+ rst.append(" :align: left")
+ rst.append("")
+
+ vl = ViewList(rst, "fakefile.rst")
+ # Create a node.
+ node = nodes.section()
+ node.document = self.state.document
+ # Parse the rst.
+ nested_parse_with_titles(self.state, vl, node)
+ return node.children
+
+
+def setup(app):
+ app.add_directive('simple_gallery', SimpleGalleryDirective)
+ return {'version': '0.1'} # identifies the version of our extension
=====================================
docs/requirements.txt
=====================================
@@ -1,3 +1,4 @@
mock
sphinx>=1.6.4
sphinxcontrib.bibtex
+sphinx_rtd_theme
=====================================
docs/sec_contribute.rst
=====================================
@@ -26,7 +26,12 @@ PyCorrFit) in numerous ways:
familiar with reStrucuredText or LaTeX, you might be able to help
out with the online documentation.
-5. Please cite: Müller et al. Bioinformatics 30(17): 2532–2533, 2014
+5. Please cite: Müller et al. Bioinformatics 30(17): 2532–2533, 2014,
+ `DOI:10.1093/bioinformatics/btu328
+ <https://dx.doi.org/10.1093/bioinformatics/btu328>`_
+
+6. Sponsor me on `GitHub <https://github.com/sponsors/paulmueller>`_
+ or donate via `Liberapay <https://liberapay.com/paulmueller>`_.
If you are planning to contribute to PyCorrFit, please contact me via
the PyCorrFit issue page on GitHub such that we may coordinate a pull
=====================================
docs/sec_gallery.rst
=====================================
@@ -2,6 +2,5 @@
Gallery
=======
-TODO:
- - Automatically insert all images from the gallery folder.
- - Add new screenshots.
\ No newline at end of file
+.. simple_gallery::
+ :dir: gallery
=====================================
pycorrfit/gui/contribute.py
=====================================
@@ -0,0 +1,81 @@
+import wx
+from wx.lib import sized_controls
+import wx.lib.agw.hyperlink as hl
+
+
+class ContributeDialog(sized_controls.SizedDialog):
+
+ def __init__(self, *args, **kwargs):
+ super(ContributeDialog, self).__init__(title="Contribute to PyCorrFit",
+ *args, **kwargs)
+ pane = self.GetContentsPane()
+
+ pane_btns = sized_controls.SizedPanel(pane)
+ pane_btns.SetSizerType('vertical')
+ pane_btns.SetSizerProps(align="center")
+
+ wx.StaticText(pane_btns, label=contribute_text)
+ wx.StaticText(pane_btns, label="\nLinks:")
+ for ii, link in enumerate(contribute_links):
+ hl.HyperLinkCtrl(pane_btns,
+ -1,
+ "[{}] {}".format(ii+1, link),
+ URL=link)
+ wx.StaticText(pane_btns, label="\n")
+
+ button_ok = wx.Button(pane_btns, label='OK')
+ button_ok.Bind(wx.EVT_BUTTON, self.on_button)
+ button_ok.SetFocus()
+ button_ok.SetSizerProps(expand=True)
+
+ self.Fit()
+
+ def on_button(self, event):
+ if self.IsModal():
+ self.EndModal(event.EventObject.Id)
+ else:
+ self.Close()
+
+
+contribute_text = """
+PyCorrFit has no funding and a vanishingly small developer community.
+My personal objective is to keep PyCorrFit operational on Linux and
+Windows which is currently limited by the free time I have available.
+
+An active community is very important for an open source project such
+as PyCorrFit. You can help this community grow (and thus help improve
+PyCorrFit) in numerous ways:
+
+1. \tTell your colleagues and peers about PyCorrFit. One of them
+ \tmight be able to contribute to the project.
+
+2. \tIf you need a new feature in PyCorrFit, publicly announce a
+ \tbounty for its implementation.
+
+3. \tIf your research heavily relies on FCS, please consider
+ \tdiverting some of your resources to the development
+ \tof PyCorrFit.
+
+4. \tYou don't have to be a Python programmer to contribute. If
+ \tyou are familiar with reStrucuredText or LaTeX, you might
+ \tbe able to help out with the online documentation.
+
+5. \tPlease cite: Müller et al. Bioinformatics 30(17): 2532–2533,
+ \t2014 [1].
+
+6. \tSponsor me on GitHub [2] or donate via Liberapay [3].
+
+If you are planning to contribute to PyCorrFit, please contact me via
+the PyCorrFit issue page on GitHub such that we may coordinate a pull
+request.
+
+Thank you!
+Paul Müller (October 2019)
+"""
+
+
+contribute_links = [
+ "https://dx.doi.org/10.1093/bioinformatics/btu328",
+ "https://github.com/sponsors/paulmueller",
+ "https://liberapay.com/paulmueller",
+ ]
=====================================
pycorrfit/gui/doc.py
=====================================
@@ -103,7 +103,8 @@ def SoftwareUsed():
"\n - wxPython "+wx.__version__
# Other software
text += "\n\nOther software:" +\
- "\n - FCS_point_correlator ({})".format(read_pt3_scripts.version) +\
+ "\n - FCS_point_correlator ({})".format(
+ read_pt3_scripts.version) +\
"\n PicoQuant file format for Python by Dominic Waithe"
if hasattr(sys, 'frozen'):
pyinst = "\n\nThis executable has been created using PyInstaller."
@@ -114,41 +115,6 @@ def SoftwareUsed():
return text
-support = """
-PyCorrFit has no funding and a vanishingly small developer community.
-My personal objective is to keep PyCorrFit operational on Linux and
-Windows which is currently limited by the free time I have available.
-
-An active community is very important for an open source project such
-as PyCorrFit. You can help this community grow (and thus help improve
-PyCorrFit) in numerous ways:
-
-1. \tTell your colleagues and peers about PyCorrFit. One of them might
- \tbe able to contribute to the project.
-
-2. \tIf you need a new feature in PyCorrFit, publicly announce a bounty
- \tfor its implementation.
-
-3. \tIf your research heavily relies on FCS, please consider diverting
- \tsome of your resources to the development of PyCorrFit.
-
-4. \tYou don't have to be a Python programmer to contribute. If you are
- \tfamiliar with reStrucuredText or LaTeX, you might be able to help
- \tout with the online documentation.
-
-5. \tPlease cite: Müller et al. Bioinformatics 30(17): 2532–2533, 2014
-
-If you are planning to contribute to PyCorrFit, please contact me via
-the PyCorrFit issue page on GitHub such that we may coordinate a pull
-request.
-
-
-Thank you!
-
-Paul Müller (May 2018)
-"""
-
-
# Standard homepage
HomePage = "http://pycorrfit.craban.de/"
# Changelog filename
=====================================
pycorrfit/gui/frontend.py
=====================================
@@ -24,6 +24,7 @@ from pycorrfit import meta
# PyCorrFit modules
+from . import contribute
from . import doc
from . import edclasses
from . import misc
@@ -189,7 +190,7 @@ class MyFrame(wx.Frame):
# Display support dialog
if hasattr(sys, "frozen"):
- self.OnSupport()
+ self.OnContribute()
def add_fitting_tab(self, event=None, modelid=None, counter=None,
select=False):
@@ -369,8 +370,8 @@ class MyFrame(wx.Frame):
menuentry = submenu.Append(model[0], model[1], model[2])
self.Bind(wx.EVT_MENU, self.add_fitting_tab, menuentry)
# help menu
- menuSupport = helpmenu.Append(wx.ID_ANY, "&Support",
- "How to (get) support (for) PyCorrFit")
+ menuContribute = helpmenu.Append(wx.ID_ANY, "&Contribute",
+ "How to contribute to PyCorrFit")
menuDocu = helpmenu.Append(wx.ID_ANY, "&Documentation",
"PyCorrFit documentation")
menuWiki = helpmenu.Append(wx.ID_ANY, "&Wiki",
@@ -418,7 +419,7 @@ class MyFrame(wx.Frame):
self.Bind(wx.EVT_MENU, self.OnLatexCheck, self.MenuUseLatex)
# Help
self.Bind(wx.EVT_MENU, self.OnSoftware, menuSoftw)
- self.Bind(wx.EVT_MENU, self.OnSupport, menuSupport)
+ self.Bind(wx.EVT_MENU, self.OnContribute, menuContribute)
self.Bind(wx.EVT_MENU, self.OnAbout, menuAbout)
self.Bind(wx.EVT_MENU, self.OnUpdate, menuUpdate)
self.Bind(wx.EVT_MENU, self.OnDocumentation, menuDocu)
@@ -631,6 +632,11 @@ class MyFrame(wx.Frame):
# Close Dialog
self.EditCommentDlg.OnClose()
+ def OnContribute(self, event=None):
+ # Show contribute dialog
+ dlg = contribute.ContributeDialog(self)
+ dlg.ShowModal()
+
def OnDeletePage(self, event=None):
"""
This method is based on the flatnotebook demo
@@ -1683,11 +1689,6 @@ class MyFrame(wx.Frame):
text = doc.SoftwareUsed()
wx.MessageBox(text, 'Software', wx.OK | wx.ICON_INFORMATION)
- def OnSupport(self, event=None):
- # Show About Information
- text = doc.support
- wx.MessageBox(text, 'Support PyCorrFit', wx.OK | wx.ICON_INFORMATION)
-
def OnTool(self, event):
eid = event.GetId()
try:
View it on GitLab: https://salsa.debian.org/med-team/pycorrfit/commit/01662a340c6ce14869b4ad7e8e2c52e0673fcf1b
--
View it on GitLab: https://salsa.debian.org/med-team/pycorrfit/commit/01662a340c6ce14869b4ad7e8e2c52e0673fcf1b
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20191204/992a04e4/attachment-0001.html>
More information about the debian-med-commit
mailing list