OASYS2-XOPPY 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- oasys2_xoppy-1.0.0/LICENSE +23 -0
- oasys2_xoppy-1.0.0/MANIFEST.in +16 -0
- oasys2_xoppy-1.0.0/OASYS2_XOPPY.egg-info/PKG-INFO +33 -0
- oasys2_xoppy-1.0.0/OASYS2_XOPPY.egg-info/SOURCES.txt +91 -0
- oasys2_xoppy-1.0.0/OASYS2_XOPPY.egg-info/dependency_links.txt +1 -0
- oasys2_xoppy-1.0.0/OASYS2_XOPPY.egg-info/entry_points.txt +6 -0
- oasys2_xoppy-1.0.0/OASYS2_XOPPY.egg-info/not-zip-safe +1 -0
- oasys2_xoppy-1.0.0/OASYS2_XOPPY.egg-info/requires.txt +2 -0
- oasys2_xoppy-1.0.0/OASYS2_XOPPY.egg-info/top_level.txt +1 -0
- oasys2_xoppy-1.0.0/PKG-INFO +33 -0
- oasys2_xoppy-1.0.0/README.txt +2 -0
- oasys2_xoppy-1.0.0/orangecontrib/__init__.py +2 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/__init__.py +3 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/menu/__init__.py +3 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/menu/xoppy_tools_menu.py +47 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/util/__init__.py +1 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/util/python_script.py +277 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/util/script/__init__.py +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/util/script/itemmodels.py +469 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/util/script/python_script.py +336 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/util/script/value.py +126 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/util/script/variable.py +542 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/util/xoppy_pymca_tools.py +49 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/__init__.py +2 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/gui/__init__.py +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/gui/image_view_with_fwhm.py +343 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/gui/messages.py +34 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/gui/ow_xoppy_widget.py +569 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/gui/ow_xoppy_widget_dabax.py +79 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/gui/text_window.py +48 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/gui/xoppy_util.py +43 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/__init__.py +18 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/icons/power1d_monochromator.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/icons/srcalc.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/icons/xoppy_2.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/icons/xoppy_mare.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/icons/xoppy_mlayer.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/icons/xoppy_power3d.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/icons/xoppy_xcrosssec.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/icons/xoppy_xcrystal.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/icons/xoppy_xf0.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/icons/xoppy_xf1f2.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/icons/xoppy_xfh.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/icons/xoppy_xinpro.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/icons/xoppy_xpower.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/icons/xoppy_xxcom.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/mare.py +293 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/multilayer.py +688 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/power1Dmonochromator.py +730 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/power3Dcomponent.py +1269 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/srcalc_idpower.py +1763 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/xcrosssec.py +400 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/xcrystal.py +639 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/xf0.py +267 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/xf1f2.py +541 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/xfh.py +478 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/xinpro.py +285 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/xpower.py +1093 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/optics/xxcom.py +270 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/__init__.py +18 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/black_body.py +182 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/bm.py +528 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/icons/xoppy_2.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/icons/xoppy_black_body.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/icons/xoppy_bm.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/icons/xoppy_undulator_power_density.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/icons/xoppy_undulator_radiation.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/icons/xoppy_undulator_spectrum.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/icons/xoppy_wiggler_radiation.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/icons/xoppy_ws.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/icons/xoppy_xtc.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/icons/xoppy_xtube_w.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/icons/xoppy_xtubes.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/icons/xoppy_xwiggler.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/tc_slit.py +577 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/undulator_power_density.py +596 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/undulator_radiation.py +841 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/undulator_spectrum.py +509 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/wiggler_radiation.py +899 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/ws.py +381 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/xtc.py +528 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/xtcap.py +619 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/xtube_w.py +160 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/xtubes.py +149 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/xwiggler.py +390 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/source/yaup.py +953 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/tools/__init__.py +19 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/tools/icons/histogram.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/tools/icons/xoppy_2.png +0 -0
- oasys2_xoppy-1.0.0/orangecontrib/xoppy/widgets/tools/plot_simple_exchange.py +144 -0
- oasys2_xoppy-1.0.0/pyproject.toml +3 -0
- oasys2_xoppy-1.0.0/setup.cfg +4 -0
- oasys2_xoppy-1.0.0/setup.py +83 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Copyright (c) 2014, Manuel Sanchez del Rio
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
|
5
|
+
modification, are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
8
|
+
list of conditions and the following disclaimer.
|
|
9
|
+
|
|
10
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
11
|
+
this list of conditions and the following disclaimer in the documentation
|
|
12
|
+
and/or other materials provided with the distribution.
|
|
13
|
+
|
|
14
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
15
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
16
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
17
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
18
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
19
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
20
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
21
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
22
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
23
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
recursive-include orangecontrib *.pyx
|
|
2
|
+
recursive-include orangecontrib *.py
|
|
3
|
+
|
|
4
|
+
recursive-include orangecontrib/xoppy/widgets *.png *.svg *.ico *.jpg *.bmp
|
|
5
|
+
|
|
6
|
+
recursive-include orangecontrib/xoppy/util/bin/darwin *
|
|
7
|
+
recursive-include orangecontrib/xoppy/util/bin/linux *
|
|
8
|
+
recursive-include orangecontrib/xoppy/util/bin/windows *
|
|
9
|
+
recursive-include orangecontrib/xoppy/util/bin_run *.txt
|
|
10
|
+
recursive-include orangecontrib/xoppy/util/data *
|
|
11
|
+
recursive-include orangecontrib/xoppy/util/doc_txt *.txt *.par
|
|
12
|
+
|
|
13
|
+
recursive-include libraries/darwin *
|
|
14
|
+
recursive-include libraries/linux *
|
|
15
|
+
|
|
16
|
+
include README.txt
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: OASYS2-XOPPY
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: XOPPY: XOP (X-ray oriented programs) in Python
|
|
5
|
+
Home-page: https://github.com/oasys-kit/XOPPY
|
|
6
|
+
Download-URL: https://github.com/oasys-kit/XOPPY
|
|
7
|
+
Author: Manuel Sanchez del Rio, Luca Rebuffi, and Bioinformatics Laboratory, FRI UL
|
|
8
|
+
Author-email: srio@esrf.eu, lrebuffi@anl.gov
|
|
9
|
+
License: GPLv3
|
|
10
|
+
Keywords: X-ray optics,simulator,oasys2
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Environment :: X11 Applications :: Qt
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Environment :: Plugins
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Intended Audience :: Science/Research
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: oasys2>=0.0.1
|
|
19
|
+
Requires-Dist: xoppylib>=1.0.40
|
|
20
|
+
Dynamic: author
|
|
21
|
+
Dynamic: author-email
|
|
22
|
+
Dynamic: classifier
|
|
23
|
+
Dynamic: description
|
|
24
|
+
Dynamic: download-url
|
|
25
|
+
Dynamic: home-page
|
|
26
|
+
Dynamic: keywords
|
|
27
|
+
Dynamic: license
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
Dynamic: requires-dist
|
|
30
|
+
Dynamic: summary
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
This is the project for XOPPY (XOP under python3) under OASYS 2
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
MANIFEST.in
|
|
3
|
+
README.txt
|
|
4
|
+
pyproject.toml
|
|
5
|
+
setup.py
|
|
6
|
+
OASYS2_XOPPY.egg-info/PKG-INFO
|
|
7
|
+
OASYS2_XOPPY.egg-info/SOURCES.txt
|
|
8
|
+
OASYS2_XOPPY.egg-info/dependency_links.txt
|
|
9
|
+
OASYS2_XOPPY.egg-info/entry_points.txt
|
|
10
|
+
OASYS2_XOPPY.egg-info/not-zip-safe
|
|
11
|
+
OASYS2_XOPPY.egg-info/requires.txt
|
|
12
|
+
OASYS2_XOPPY.egg-info/top_level.txt
|
|
13
|
+
orangecontrib/__init__.py
|
|
14
|
+
orangecontrib/xoppy/__init__.py
|
|
15
|
+
orangecontrib/xoppy/menu/__init__.py
|
|
16
|
+
orangecontrib/xoppy/menu/xoppy_tools_menu.py
|
|
17
|
+
orangecontrib/xoppy/util/__init__.py
|
|
18
|
+
orangecontrib/xoppy/util/python_script.py
|
|
19
|
+
orangecontrib/xoppy/util/xoppy_pymca_tools.py
|
|
20
|
+
orangecontrib/xoppy/util/script/__init__.py
|
|
21
|
+
orangecontrib/xoppy/util/script/itemmodels.py
|
|
22
|
+
orangecontrib/xoppy/util/script/python_script.py
|
|
23
|
+
orangecontrib/xoppy/util/script/value.py
|
|
24
|
+
orangecontrib/xoppy/util/script/variable.py
|
|
25
|
+
orangecontrib/xoppy/widgets/__init__.py
|
|
26
|
+
orangecontrib/xoppy/widgets/gui/__init__.py
|
|
27
|
+
orangecontrib/xoppy/widgets/gui/image_view_with_fwhm.py
|
|
28
|
+
orangecontrib/xoppy/widgets/gui/messages.py
|
|
29
|
+
orangecontrib/xoppy/widgets/gui/ow_xoppy_widget.py
|
|
30
|
+
orangecontrib/xoppy/widgets/gui/ow_xoppy_widget_dabax.py
|
|
31
|
+
orangecontrib/xoppy/widgets/gui/text_window.py
|
|
32
|
+
orangecontrib/xoppy/widgets/gui/xoppy_util.py
|
|
33
|
+
orangecontrib/xoppy/widgets/optics/__init__.py
|
|
34
|
+
orangecontrib/xoppy/widgets/optics/mare.py
|
|
35
|
+
orangecontrib/xoppy/widgets/optics/multilayer.py
|
|
36
|
+
orangecontrib/xoppy/widgets/optics/power1Dmonochromator.py
|
|
37
|
+
orangecontrib/xoppy/widgets/optics/power3Dcomponent.py
|
|
38
|
+
orangecontrib/xoppy/widgets/optics/srcalc_idpower.py
|
|
39
|
+
orangecontrib/xoppy/widgets/optics/xcrosssec.py
|
|
40
|
+
orangecontrib/xoppy/widgets/optics/xcrystal.py
|
|
41
|
+
orangecontrib/xoppy/widgets/optics/xf0.py
|
|
42
|
+
orangecontrib/xoppy/widgets/optics/xf1f2.py
|
|
43
|
+
orangecontrib/xoppy/widgets/optics/xfh.py
|
|
44
|
+
orangecontrib/xoppy/widgets/optics/xinpro.py
|
|
45
|
+
orangecontrib/xoppy/widgets/optics/xpower.py
|
|
46
|
+
orangecontrib/xoppy/widgets/optics/xxcom.py
|
|
47
|
+
orangecontrib/xoppy/widgets/optics/icons/power1d_monochromator.png
|
|
48
|
+
orangecontrib/xoppy/widgets/optics/icons/srcalc.png
|
|
49
|
+
orangecontrib/xoppy/widgets/optics/icons/xoppy_2.png
|
|
50
|
+
orangecontrib/xoppy/widgets/optics/icons/xoppy_mare.png
|
|
51
|
+
orangecontrib/xoppy/widgets/optics/icons/xoppy_mlayer.png
|
|
52
|
+
orangecontrib/xoppy/widgets/optics/icons/xoppy_power3d.png
|
|
53
|
+
orangecontrib/xoppy/widgets/optics/icons/xoppy_xcrosssec.png
|
|
54
|
+
orangecontrib/xoppy/widgets/optics/icons/xoppy_xcrystal.png
|
|
55
|
+
orangecontrib/xoppy/widgets/optics/icons/xoppy_xf0.png
|
|
56
|
+
orangecontrib/xoppy/widgets/optics/icons/xoppy_xf1f2.png
|
|
57
|
+
orangecontrib/xoppy/widgets/optics/icons/xoppy_xfh.png
|
|
58
|
+
orangecontrib/xoppy/widgets/optics/icons/xoppy_xinpro.png
|
|
59
|
+
orangecontrib/xoppy/widgets/optics/icons/xoppy_xpower.png
|
|
60
|
+
orangecontrib/xoppy/widgets/optics/icons/xoppy_xxcom.png
|
|
61
|
+
orangecontrib/xoppy/widgets/source/__init__.py
|
|
62
|
+
orangecontrib/xoppy/widgets/source/black_body.py
|
|
63
|
+
orangecontrib/xoppy/widgets/source/bm.py
|
|
64
|
+
orangecontrib/xoppy/widgets/source/tc_slit.py
|
|
65
|
+
orangecontrib/xoppy/widgets/source/undulator_power_density.py
|
|
66
|
+
orangecontrib/xoppy/widgets/source/undulator_radiation.py
|
|
67
|
+
orangecontrib/xoppy/widgets/source/undulator_spectrum.py
|
|
68
|
+
orangecontrib/xoppy/widgets/source/wiggler_radiation.py
|
|
69
|
+
orangecontrib/xoppy/widgets/source/ws.py
|
|
70
|
+
orangecontrib/xoppy/widgets/source/xtc.py
|
|
71
|
+
orangecontrib/xoppy/widgets/source/xtcap.py
|
|
72
|
+
orangecontrib/xoppy/widgets/source/xtube_w.py
|
|
73
|
+
orangecontrib/xoppy/widgets/source/xtubes.py
|
|
74
|
+
orangecontrib/xoppy/widgets/source/xwiggler.py
|
|
75
|
+
orangecontrib/xoppy/widgets/source/yaup.py
|
|
76
|
+
orangecontrib/xoppy/widgets/source/icons/xoppy_2.png
|
|
77
|
+
orangecontrib/xoppy/widgets/source/icons/xoppy_black_body.png
|
|
78
|
+
orangecontrib/xoppy/widgets/source/icons/xoppy_bm.png
|
|
79
|
+
orangecontrib/xoppy/widgets/source/icons/xoppy_undulator_power_density.png
|
|
80
|
+
orangecontrib/xoppy/widgets/source/icons/xoppy_undulator_radiation.png
|
|
81
|
+
orangecontrib/xoppy/widgets/source/icons/xoppy_undulator_spectrum.png
|
|
82
|
+
orangecontrib/xoppy/widgets/source/icons/xoppy_wiggler_radiation.png
|
|
83
|
+
orangecontrib/xoppy/widgets/source/icons/xoppy_ws.png
|
|
84
|
+
orangecontrib/xoppy/widgets/source/icons/xoppy_xtc.png
|
|
85
|
+
orangecontrib/xoppy/widgets/source/icons/xoppy_xtube_w.png
|
|
86
|
+
orangecontrib/xoppy/widgets/source/icons/xoppy_xtubes.png
|
|
87
|
+
orangecontrib/xoppy/widgets/source/icons/xoppy_xwiggler.png
|
|
88
|
+
orangecontrib/xoppy/widgets/tools/__init__.py
|
|
89
|
+
orangecontrib/xoppy/widgets/tools/plot_simple_exchange.py
|
|
90
|
+
orangecontrib/xoppy/widgets/tools/icons/histogram.png
|
|
91
|
+
orangecontrib/xoppy/widgets/tools/icons/xoppy_2.png
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
orangecontrib
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: OASYS2-XOPPY
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: XOPPY: XOP (X-ray oriented programs) in Python
|
|
5
|
+
Home-page: https://github.com/oasys-kit/XOPPY
|
|
6
|
+
Download-URL: https://github.com/oasys-kit/XOPPY
|
|
7
|
+
Author: Manuel Sanchez del Rio, Luca Rebuffi, and Bioinformatics Laboratory, FRI UL
|
|
8
|
+
Author-email: srio@esrf.eu, lrebuffi@anl.gov
|
|
9
|
+
License: GPLv3
|
|
10
|
+
Keywords: X-ray optics,simulator,oasys2
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Environment :: X11 Applications :: Qt
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Environment :: Plugins
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Intended Audience :: Science/Research
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: oasys2>=0.0.1
|
|
19
|
+
Requires-Dist: xoppylib>=1.0.40
|
|
20
|
+
Dynamic: author
|
|
21
|
+
Dynamic: author-email
|
|
22
|
+
Dynamic: classifier
|
|
23
|
+
Dynamic: description
|
|
24
|
+
Dynamic: download-url
|
|
25
|
+
Dynamic: home-page
|
|
26
|
+
Dynamic: keywords
|
|
27
|
+
Dynamic: license
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
Dynamic: requires-dist
|
|
30
|
+
Dynamic: summary
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
This is the project for XOPPY (XOP under python3) under OASYS 2
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from PyQt5 import QtWidgets
|
|
2
|
+
|
|
3
|
+
from oasys2.canvas.menus.menu import OMenu
|
|
4
|
+
|
|
5
|
+
class XoppyToolsMenu(OMenu):
|
|
6
|
+
|
|
7
|
+
def __init__(self):
|
|
8
|
+
super().__init__(name="Xoppy Tools")
|
|
9
|
+
|
|
10
|
+
self.addSubMenu("Xoppy Tool 1")
|
|
11
|
+
self.addSubMenu("Xoppy Tool 2")
|
|
12
|
+
self.addSeparator()
|
|
13
|
+
self.addSubMenu("Xoppy Tool 3")
|
|
14
|
+
|
|
15
|
+
def executeAction_1(self, action):
|
|
16
|
+
self.showWarningMessage("Xoppy Tool 1")
|
|
17
|
+
|
|
18
|
+
def executeAction_2(self, action):
|
|
19
|
+
self.showWarningMessage("Xoppy Tool 2")
|
|
20
|
+
|
|
21
|
+
def executeAction_3(self, action):
|
|
22
|
+
self.showWarningMessage("Xoppy Tool 3")
|
|
23
|
+
|
|
24
|
+
def showConfirmMessage(self, message):
|
|
25
|
+
msgBox = QtWidgets.QMessageBox()
|
|
26
|
+
msgBox.setIcon(QtWidgets.QMessageBox.Question)
|
|
27
|
+
msgBox.setText(message)
|
|
28
|
+
msgBox.setInformativeText(
|
|
29
|
+
"Element will be omitted.\nDo you want to continue importing procedure (a broken link will appear)?")
|
|
30
|
+
msgBox.setStandardButtons(QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
|
|
31
|
+
msgBox.setDefaultButton(QtWidgets.QMessageBox.No)
|
|
32
|
+
ret = msgBox.exec_()
|
|
33
|
+
return ret
|
|
34
|
+
|
|
35
|
+
def showWarningMessage(self, message):
|
|
36
|
+
msgBox = QtWidgets.QMessageBox()
|
|
37
|
+
msgBox.setIcon(QtWidgets.QMessageBox.Warning)
|
|
38
|
+
msgBox.setText(message)
|
|
39
|
+
msgBox.setStandardButtons(QtWidgets.QMessageBox.Ok)
|
|
40
|
+
msgBox.exec_()
|
|
41
|
+
|
|
42
|
+
def showCriticalMessage(self, message):
|
|
43
|
+
msgBox = QtWidgets.QMessageBox()
|
|
44
|
+
msgBox.setIcon(QtWidgets.QMessageBox.Critical)
|
|
45
|
+
msgBox.setText(message)
|
|
46
|
+
msgBox.setStandardButtons(QtWidgets.QMessageBox.Ok)
|
|
47
|
+
msgBox.exec_()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import os, sys, code, itertools
|
|
2
|
+
|
|
3
|
+
from PyQt5 import QtWidgets
|
|
4
|
+
from PyQt5.QtWidgets import QFileDialog
|
|
5
|
+
from orangewidget import gui
|
|
6
|
+
from oasys2.widget import gui as oasysgui
|
|
7
|
+
|
|
8
|
+
from PyQt5.QtWidgets import QWidget, QVBoxLayout
|
|
9
|
+
|
|
10
|
+
from PyQt5.QtGui import QTextCursor
|
|
11
|
+
from PyQt5.QtCore import Qt
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class PythonScript(QWidget):
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def __init__(self):
|
|
18
|
+
super().__init__()
|
|
19
|
+
|
|
20
|
+
layout = QVBoxLayout()
|
|
21
|
+
|
|
22
|
+
self.code_area = oasysgui.textArea(readOnly=False)
|
|
23
|
+
self.code_area.setStyleSheet("background-color: white; font-family: Courier, monospace;")
|
|
24
|
+
self.console = PythonConsole(self.__dict__, self)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
button_box = oasysgui.widgetBox(None, "", addSpace=True, orientation="horizontal")
|
|
28
|
+
gui.button(button_box, self, "Run Script", callback=self.execute_script, height=40)
|
|
29
|
+
gui.button(button_box, self, "Save Script to File", callback=self.save_script, height=40)
|
|
30
|
+
|
|
31
|
+
layout.addWidget(self.code_area)
|
|
32
|
+
layout.addWidget(self.console)
|
|
33
|
+
layout.addWidget(button_box)
|
|
34
|
+
|
|
35
|
+
self.setLayout(layout)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def execute_script(self):
|
|
39
|
+
self._script = str(self.code_area.toPlainText())
|
|
40
|
+
self.console.write("\nRunning script:\n")
|
|
41
|
+
self.console.push("exec(_script)")
|
|
42
|
+
self.console.new_prompt(sys.ps1)
|
|
43
|
+
|
|
44
|
+
def save_script(self):
|
|
45
|
+
file_name = QFileDialog.getSaveFileName(self, "Save File to Disk", os.getcwd(), filter='*.py')[0]
|
|
46
|
+
|
|
47
|
+
if not file_name is None:
|
|
48
|
+
if not file_name.strip() == "":
|
|
49
|
+
if os.path.splitext(file_name)[1].lower() != ".py":
|
|
50
|
+
file_name += ".py"
|
|
51
|
+
file = open(file_name, "w")
|
|
52
|
+
file.write(str(self.code_area.toPlainText()))
|
|
53
|
+
file.close()
|
|
54
|
+
|
|
55
|
+
QtWidgets.QMessageBox.information(self, "Information",
|
|
56
|
+
"File " + file_name + " written to disk",
|
|
57
|
+
QtWidgets.QMessageBox.Ok)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def clear(self):
|
|
61
|
+
self.code_area.setText("")
|
|
62
|
+
|
|
63
|
+
def set_code(self,text):
|
|
64
|
+
self.clear()
|
|
65
|
+
|
|
66
|
+
try:
|
|
67
|
+
self.code_area.setText(text)
|
|
68
|
+
except Exception as e:
|
|
69
|
+
self.code_area.setText("Problem in writing python script:\n" + str(sys.exc_info()[0]) + ": " + str(sys.exc_info()[1]))
|
|
70
|
+
|
|
71
|
+
def add_code(self,text):
|
|
72
|
+
code_old = self.get_code()
|
|
73
|
+
self.set_code(code_old + "\n" + text)
|
|
74
|
+
|
|
75
|
+
def get_code(self):
|
|
76
|
+
return self.code_area.toPlainText()
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def interleave(seq1, seq2):
|
|
80
|
+
"""
|
|
81
|
+
Interleave elements of `seq2` between consecutive elements of `seq1`.
|
|
82
|
+
|
|
83
|
+
>>> list(interleave([1, 3, 5], [2, 4]))
|
|
84
|
+
[1, 2, 3, 4, 5]
|
|
85
|
+
|
|
86
|
+
"""
|
|
87
|
+
iterator1, iterator2 = iter(seq1), iter(seq2)
|
|
88
|
+
leading = next(iterator1)
|
|
89
|
+
for element in iterator1:
|
|
90
|
+
yield leading
|
|
91
|
+
yield next(iterator2)
|
|
92
|
+
leading = element
|
|
93
|
+
|
|
94
|
+
yield leading
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class PythonConsole(QtWidgets.QPlainTextEdit, code.InteractiveConsole):
|
|
98
|
+
def __init__(self, locals=None, parent=None):
|
|
99
|
+
QtWidgets.QPlainTextEdit.__init__(self, parent)
|
|
100
|
+
code.InteractiveConsole.__init__(self, locals)
|
|
101
|
+
self.history, self.historyInd = [""], 0
|
|
102
|
+
self.loop = self.interact()
|
|
103
|
+
next(self.loop)
|
|
104
|
+
self.setStyleSheet("background-color:black; color: white; font-family: Courier, monospace;")
|
|
105
|
+
|
|
106
|
+
def setLocals(self, locals):
|
|
107
|
+
self.locals = locals
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def flush(self):
|
|
111
|
+
pass
|
|
112
|
+
|
|
113
|
+
def interact(self, banner=None):
|
|
114
|
+
try:
|
|
115
|
+
sys.ps1
|
|
116
|
+
except AttributeError:
|
|
117
|
+
sys.ps1 = ">>> "
|
|
118
|
+
try:
|
|
119
|
+
sys.ps2
|
|
120
|
+
except AttributeError:
|
|
121
|
+
sys.ps2 = "... "
|
|
122
|
+
cprt = ('Type "help", "copyright", "credits" or "license" '
|
|
123
|
+
'for more information.')
|
|
124
|
+
if banner is None:
|
|
125
|
+
self.write("Python %s on %s\n%s\n(%s)\n" %
|
|
126
|
+
(sys.version, sys.platform, cprt,
|
|
127
|
+
self.__class__.__name__))
|
|
128
|
+
else:
|
|
129
|
+
self.write("%s\n" % str(banner))
|
|
130
|
+
more = 0
|
|
131
|
+
while 1:
|
|
132
|
+
try:
|
|
133
|
+
if more:
|
|
134
|
+
prompt = sys.ps2
|
|
135
|
+
else:
|
|
136
|
+
prompt = sys.ps1
|
|
137
|
+
self.new_prompt(prompt)
|
|
138
|
+
yield
|
|
139
|
+
try:
|
|
140
|
+
line = self.raw_input(prompt)
|
|
141
|
+
except EOFError:
|
|
142
|
+
self.write("\n")
|
|
143
|
+
break
|
|
144
|
+
else:
|
|
145
|
+
more = self.push(line)
|
|
146
|
+
except KeyboardInterrupt:
|
|
147
|
+
self.write("\nKeyboardInterrupt\n")
|
|
148
|
+
self.resetbuffer()
|
|
149
|
+
more = 0
|
|
150
|
+
|
|
151
|
+
def raw_input(self, prompt):
|
|
152
|
+
input = str(self.document().lastBlock().previous().text())
|
|
153
|
+
return input[len(prompt):]
|
|
154
|
+
|
|
155
|
+
def new_prompt(self, prompt):
|
|
156
|
+
self.write(prompt)
|
|
157
|
+
self.newPromptPos = self.textCursor().position()
|
|
158
|
+
|
|
159
|
+
def write(self, data):
|
|
160
|
+
cursor = QTextCursor(self.document())
|
|
161
|
+
cursor.movePosition(QTextCursor.End, QTextCursor.MoveAnchor)
|
|
162
|
+
cursor.insertText(data)
|
|
163
|
+
self.setTextCursor(cursor)
|
|
164
|
+
self.ensureCursorVisible()
|
|
165
|
+
|
|
166
|
+
def writelines(self, lines):
|
|
167
|
+
for line in lines:
|
|
168
|
+
self.write(line)
|
|
169
|
+
|
|
170
|
+
def push(self, line):
|
|
171
|
+
if self.history[0] != line:
|
|
172
|
+
self.history.insert(0, line)
|
|
173
|
+
self.historyInd = 0
|
|
174
|
+
|
|
175
|
+
saved = sys.stdout, sys.stderr
|
|
176
|
+
try:
|
|
177
|
+
sys.stdout, sys.stderr = self, self
|
|
178
|
+
return code.InteractiveConsole.push(self, line)
|
|
179
|
+
finally:
|
|
180
|
+
sys.stdout, sys.stderr = saved
|
|
181
|
+
|
|
182
|
+
def setLine(self, line):
|
|
183
|
+
cursor = QTextCursor(self.document())
|
|
184
|
+
cursor.movePosition(QTextCursor.End)
|
|
185
|
+
cursor.setPosition(self.newPromptPos, QTextCursor.KeepAnchor)
|
|
186
|
+
cursor.removeSelectedText()
|
|
187
|
+
cursor.insertText(line)
|
|
188
|
+
self.setTextCursor(cursor)
|
|
189
|
+
|
|
190
|
+
def keyPressEvent(self, event):
|
|
191
|
+
if event.key() == Qt.Key_Return:
|
|
192
|
+
self.write("\n")
|
|
193
|
+
next(self.loop)
|
|
194
|
+
elif event.key() == Qt.Key_Up:
|
|
195
|
+
self.historyUp()
|
|
196
|
+
elif event.key() == Qt.Key_Down:
|
|
197
|
+
self.historyDown()
|
|
198
|
+
elif event.key() == Qt.Key_Tab:
|
|
199
|
+
self.complete()
|
|
200
|
+
elif event.key() in [Qt.Key_Left, Qt.Key_Backspace]:
|
|
201
|
+
if self.textCursor().position() > self.newPromptPos:
|
|
202
|
+
QtWidgets.QPlainTextEdit.keyPressEvent(self, event)
|
|
203
|
+
else:
|
|
204
|
+
QtWidgets.QPlainTextEdit.keyPressEvent(self, event)
|
|
205
|
+
|
|
206
|
+
def historyUp(self):
|
|
207
|
+
self.setLine(self.history[self.historyInd])
|
|
208
|
+
self.historyInd = min(self.historyInd + 1, len(self.history) - 1)
|
|
209
|
+
|
|
210
|
+
def historyDown(self):
|
|
211
|
+
self.setLine(self.history[self.historyInd])
|
|
212
|
+
self.historyInd = max(self.historyInd - 1, 0)
|
|
213
|
+
|
|
214
|
+
def complete(self):
|
|
215
|
+
pass
|
|
216
|
+
|
|
217
|
+
def _moveCursorToInputLine(self):
|
|
218
|
+
"""
|
|
219
|
+
Move the cursor to the input line if not already there. If the cursor
|
|
220
|
+
if already in the input line (at position greater or equal to
|
|
221
|
+
`newPromptPos`) it is left unchanged, otherwise it is moved at the
|
|
222
|
+
end.
|
|
223
|
+
|
|
224
|
+
"""
|
|
225
|
+
cursor = self.textCursor()
|
|
226
|
+
pos = cursor.position()
|
|
227
|
+
if pos < self.newPromptPos:
|
|
228
|
+
cursor.movePosition(QTextCursor.End)
|
|
229
|
+
self.setTextCursor(cursor)
|
|
230
|
+
|
|
231
|
+
def pasteCode(self, source):
|
|
232
|
+
"""
|
|
233
|
+
Paste source code into the console.
|
|
234
|
+
"""
|
|
235
|
+
self._moveCursorToInputLine()
|
|
236
|
+
|
|
237
|
+
for line in interleave(source.splitlines(), itertools.repeat("\n")):
|
|
238
|
+
if line != "\n":
|
|
239
|
+
self.insertPlainText(line)
|
|
240
|
+
else:
|
|
241
|
+
self.write("\n")
|
|
242
|
+
next(self.loop)
|
|
243
|
+
|
|
244
|
+
def insertFromMimeData(self, source):
|
|
245
|
+
"""
|
|
246
|
+
Reimplemented from QPlainTextEdit.insertFromMimeData.
|
|
247
|
+
"""
|
|
248
|
+
if source.hasText():
|
|
249
|
+
self.pasteCode(str(source.text()))
|
|
250
|
+
return
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
if __name__ == "__main__":
|
|
255
|
+
|
|
256
|
+
from PyQt5.QtWidgets import QApplication
|
|
257
|
+
app = QApplication([])
|
|
258
|
+
|
|
259
|
+
widget = QWidget()
|
|
260
|
+
|
|
261
|
+
layout = QVBoxLayout()
|
|
262
|
+
|
|
263
|
+
oo = PythonScript()
|
|
264
|
+
|
|
265
|
+
oo.set_code("print('Hello world')\n")
|
|
266
|
+
oo.add_code("print('Hello moon')\n")
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
print(">>",oo.get_code())
|
|
270
|
+
|
|
271
|
+
layout.addWidget(oo)
|
|
272
|
+
|
|
273
|
+
widget.setLayout(layout)
|
|
274
|
+
|
|
275
|
+
widget.show()
|
|
276
|
+
|
|
277
|
+
app.exec_()
|
|
File without changes
|