-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:FCS-analysis/PyCorrFit
- Loading branch information
Showing
11 changed files
with
172 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github: paulmueller | ||
liberapay: paulmueller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
mock | ||
sphinx>=1.6.4 | ||
sphinxcontrib.bibtex | ||
sphinx_rtd_theme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters