scipion-pyworkflow 3.10.5__py3-none-any.whl → 3.11.0__py3-none-any.whl
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.
- pyworkflow/config.py +131 -67
- pyworkflow/constants.py +12 -2
- pyworkflow/object.py +3 -2
- pyworkflow/plugin.py +93 -44
- pyworkflow/project/scripts/fix_links.py +4 -1
- pyworkflow/resources/showj/arrowDown.png +0 -0
- pyworkflow/resources/showj/arrowUp.png +0 -0
- pyworkflow/resources/showj/background_section.png +0 -0
- pyworkflow/resources/showj/colRowModeOff.png +0 -0
- pyworkflow/resources/showj/colRowModeOn.png +0 -0
- pyworkflow/resources/showj/delete.png +0 -0
- pyworkflow/resources/showj/doc_icon.png +0 -0
- pyworkflow/resources/showj/download_icon.png +0 -0
- pyworkflow/resources/showj/enabled_gallery.png +0 -0
- pyworkflow/resources/showj/galleryViewOff.png +0 -0
- pyworkflow/resources/showj/galleryViewOn.png +0 -0
- pyworkflow/resources/showj/goto.png +0 -0
- pyworkflow/resources/showj/menu.png +0 -0
- pyworkflow/resources/showj/separator.png +0 -0
- pyworkflow/resources/showj/tableViewOff.png +0 -0
- pyworkflow/resources/showj/tableViewOn.png +0 -0
- pyworkflow/resources/showj/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- pyworkflow/resources/showj/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- pyworkflow/resources/showj/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- pyworkflow/resources/showj/volumeOff.png +0 -0
- pyworkflow/resources/showj/volumeOn.png +0 -0
- pyworkflow/viewer.py +23 -1
- pyworkflowtests/objects.py +2 -2
- pyworkflowtests/protocols.py +1 -3
- {scipion_pyworkflow-3.10.5.dist-info → scipion_pyworkflow-3.11.0.dist-info}/METADATA +21 -25
- scipion_pyworkflow-3.11.0.dist-info/RECORD +71 -0
- {scipion_pyworkflow-3.10.5.dist-info → scipion_pyworkflow-3.11.0.dist-info}/WHEEL +1 -1
- scipion_pyworkflow-3.11.0.dist-info/entry_points.txt +2 -0
- pyworkflow/apps/__init__.py +0 -29
- pyworkflow/apps/pw_manager.py +0 -37
- pyworkflow/apps/pw_plot.py +0 -51
- pyworkflow/apps/pw_project.py +0 -113
- pyworkflow/apps/pw_protocol_list.py +0 -143
- pyworkflow/apps/pw_protocol_run.py +0 -51
- pyworkflow/apps/pw_run_tests.py +0 -267
- pyworkflow/apps/pw_schedule_run.py +0 -322
- pyworkflow/apps/pw_sleep.py +0 -37
- pyworkflow/apps/pw_sync_data.py +0 -439
- pyworkflow/apps/pw_viewer.py +0 -78
- pyworkflow/gui/__init__.py +0 -36
- pyworkflow/gui/browser.py +0 -726
- pyworkflow/gui/canvas.py +0 -1190
- pyworkflow/gui/dialog.py +0 -977
- pyworkflow/gui/form.py +0 -2637
- pyworkflow/gui/graph.py +0 -247
- pyworkflow/gui/graph_layout.py +0 -271
- pyworkflow/gui/gui.py +0 -566
- pyworkflow/gui/matplotlib_image.py +0 -233
- pyworkflow/gui/plotter.py +0 -247
- pyworkflow/gui/project/__init__.py +0 -25
- pyworkflow/gui/project/base.py +0 -192
- pyworkflow/gui/project/constants.py +0 -139
- pyworkflow/gui/project/labels.py +0 -205
- pyworkflow/gui/project/project.py +0 -492
- pyworkflow/gui/project/searchprotocol.py +0 -154
- pyworkflow/gui/project/searchrun.py +0 -181
- pyworkflow/gui/project/steps.py +0 -171
- pyworkflow/gui/project/utils.py +0 -332
- pyworkflow/gui/project/variables.py +0 -179
- pyworkflow/gui/project/viewdata.py +0 -472
- pyworkflow/gui/project/viewprojects.py +0 -510
- pyworkflow/gui/project/viewprotocols.py +0 -2093
- pyworkflow/gui/project/viewprotocols_extra.py +0 -560
- pyworkflow/gui/text.py +0 -771
- pyworkflow/gui/tooltip.py +0 -185
- pyworkflow/gui/tree.py +0 -684
- pyworkflow/gui/widgets.py +0 -307
- pyworkflow/mapper/__init__.py +0 -26
- pyworkflow/mapper/mapper.py +0 -222
- pyworkflow/mapper/sqlite.py +0 -1578
- pyworkflow/mapper/sqlite_db.py +0 -145
- pyworkflow/project/__init__.py +0 -31
- pyworkflow/project/config.py +0 -454
- pyworkflow/project/manager.py +0 -180
- pyworkflow/project/project.py +0 -2010
- pyworkflow/protocol/__init__.py +0 -38
- pyworkflow/protocol/bibtex.py +0 -48
- pyworkflow/protocol/constants.py +0 -87
- pyworkflow/protocol/executor.py +0 -455
- pyworkflow/protocol/hosts.py +0 -313
- pyworkflow/protocol/launch.py +0 -270
- pyworkflow/protocol/package.py +0 -42
- pyworkflow/protocol/params.py +0 -741
- pyworkflow/protocol/protocol.py +0 -2582
- pyworkflow/tests/__init__.py +0 -29
- pyworkflow/tests/test_utils.py +0 -25
- pyworkflow/tests/tests.py +0 -341
- pyworkflow/utils/__init__.py +0 -38
- pyworkflow/utils/dataset.py +0 -414
- pyworkflow/utils/echo.py +0 -104
- pyworkflow/utils/graph.py +0 -169
- pyworkflow/utils/log.py +0 -284
- pyworkflow/utils/path.py +0 -528
- pyworkflow/utils/process.py +0 -132
- pyworkflow/utils/profiler.py +0 -92
- pyworkflow/utils/progressbar.py +0 -154
- pyworkflow/utils/properties.py +0 -631
- pyworkflow/utils/reflection.py +0 -129
- pyworkflow/utils/utils.py +0 -879
- pyworkflow/utils/which.py +0 -229
- pyworkflow/webservices/__init__.py +0 -8
- pyworkflow/webservices/config.py +0 -11
- pyworkflow/webservices/notifier.py +0 -162
- pyworkflow/webservices/repository.py +0 -59
- pyworkflow/webservices/workflowhub.py +0 -74
- pyworkflowtests/tests/__init__.py +0 -0
- pyworkflowtests/tests/test_canvas.py +0 -72
- pyworkflowtests/tests/test_domain.py +0 -45
- pyworkflowtests/tests/test_logs.py +0 -74
- pyworkflowtests/tests/test_mappers.py +0 -392
- pyworkflowtests/tests/test_object.py +0 -507
- pyworkflowtests/tests/test_project.py +0 -42
- pyworkflowtests/tests/test_protocol_execution.py +0 -135
- pyworkflowtests/tests/test_protocol_export.py +0 -78
- pyworkflowtests/tests/test_protocol_output.py +0 -158
- pyworkflowtests/tests/test_streaming.py +0 -47
- pyworkflowtests/tests/test_utils.py +0 -210
- scipion_pyworkflow-3.10.5.dist-info/RECORD +0 -140
- scipion_pyworkflow-3.10.5.dist-info/dependency_links.txt +0 -1
- scipion_pyworkflow-3.10.5.dist-info/entry_points.txt +0 -5
- {scipion_pyworkflow-3.10.5.dist-info → scipion_pyworkflow-3.11.0.dist-info/licenses}/LICENSE.txt +0 -0
- {scipion_pyworkflow-3.10.5.dist-info → scipion_pyworkflow-3.11.0.dist-info}/top_level.txt +0 -0
pyworkflow/project/manager.py
DELETED
@@ -1,180 +0,0 @@
|
|
1
|
-
# **************************************************************************
|
2
|
-
# *
|
3
|
-
# * Authors: J.M. De la Rosa Trevin (jmdelarosa@cnb.csic.es)
|
4
|
-
# *
|
5
|
-
# * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
|
6
|
-
# *
|
7
|
-
# * This program is free software; you can redistribute it and/or modify
|
8
|
-
# * it under the terms of the GNU General Public License as published by
|
9
|
-
# * the Free Software Foundation; either version 3 of the License, or
|
10
|
-
# * (at your option) any later version.
|
11
|
-
# *
|
12
|
-
# * This program is distributed in the hope that it will be useful,
|
13
|
-
# * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
-
# * GNU General Public License for more details.
|
16
|
-
# *
|
17
|
-
# * You should have received a copy of the GNU General Public License
|
18
|
-
# * along with this program; if not, write to the Free Software
|
19
|
-
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
20
|
-
# * 02111-1307 USA
|
21
|
-
# *
|
22
|
-
# * All comments concerning this program package may be sent to the
|
23
|
-
# * e-mail address 'scipion@cnb.csic.es'
|
24
|
-
# *
|
25
|
-
# **************************************************************************
|
26
|
-
"""
|
27
|
-
This modules handles the System management
|
28
|
-
"""
|
29
|
-
|
30
|
-
import os
|
31
|
-
|
32
|
-
import pyworkflow as pw
|
33
|
-
import pyworkflow.utils as pwutils
|
34
|
-
from .project import Project
|
35
|
-
|
36
|
-
|
37
|
-
class ProjectInfo(object):
|
38
|
-
"""Class to store some information about the project"""
|
39
|
-
def __init__(self, projName, mTime, cTime, path):
|
40
|
-
"""At least it receives the Project Name and its modification time"""
|
41
|
-
self.projName = projName
|
42
|
-
self.mTime = mTime
|
43
|
-
self.cTime = cTime
|
44
|
-
self.path = path
|
45
|
-
|
46
|
-
def __str__(self):
|
47
|
-
return "%s - %s" % (self.projName, self.path)
|
48
|
-
|
49
|
-
def getName(self):
|
50
|
-
return self.projName
|
51
|
-
|
52
|
-
def getModificationTime(self):
|
53
|
-
return self.mTime
|
54
|
-
|
55
|
-
def getCreationTime(self):
|
56
|
-
return self.cTime
|
57
|
-
|
58
|
-
def isLink(self):
|
59
|
-
return os.path.islink(self.path)
|
60
|
-
|
61
|
-
def realPath(self):
|
62
|
-
return os.path.realpath(self.path)
|
63
|
-
|
64
|
-
|
65
|
-
class Manager(object):
|
66
|
-
""" Manage all projects of a given workspace, for a given Domain.
|
67
|
-
(i.e, listing projects, creating, deleting or querying info)
|
68
|
-
"""
|
69
|
-
def __init__(self, workspace=None):
|
70
|
-
"""
|
71
|
-
Params:
|
72
|
-
workspace: path to where the user's workspace is. A subfolder
|
73
|
-
named 'projects' is expected. If workspace is None, the workspace
|
74
|
-
will be taken from the global configuration.
|
75
|
-
"""
|
76
|
-
ws = workspace or pw.Config.SCIPION_USER_DATA
|
77
|
-
self.PROJECTS = os.path.join(ws, 'projects')
|
78
|
-
|
79
|
-
def getProjectPath(self, projectName):
|
80
|
-
"""Return the project path given the name"""
|
81
|
-
return os.path.join(self.PROJECTS, projectName)
|
82
|
-
|
83
|
-
def listProjects(self, sortByDate=True):
|
84
|
-
"""Return a list with all existing projects
|
85
|
-
And some other project info
|
86
|
-
If sortByData is True, recently modified projects will be first"""
|
87
|
-
projList = []
|
88
|
-
pw.utils.makePath(self.PROJECTS)
|
89
|
-
for f in os.listdir(self.PROJECTS):
|
90
|
-
p = self.getProjectPath(f)
|
91
|
-
if os.path.isdir(p):
|
92
|
-
stat = os.stat(p)
|
93
|
-
projList.append(ProjectInfo(f, stat.st_mtime, stat.st_ctime, p))
|
94
|
-
|
95
|
-
if sortByDate:
|
96
|
-
projList.sort(key=lambda k: k.mTime, reverse=True)
|
97
|
-
return projList
|
98
|
-
|
99
|
-
def createProject(self, projectName, runsView=1,
|
100
|
-
hostsConf=None, protocolsConf=None, location=None, comment=None):
|
101
|
-
"""Create a new project.
|
102
|
-
confs dict can contain customs .conf files
|
103
|
-
for: menus, protocols, or hosts
|
104
|
-
"""
|
105
|
-
# Clean project name from undesired characters
|
106
|
-
projectName = Project.cleanProjectName(projectName)
|
107
|
-
|
108
|
-
# If location is not None create project on it (if exists)
|
109
|
-
if location is None:
|
110
|
-
projectPath = self.getProjectPath(projectName)
|
111
|
-
else:
|
112
|
-
projectPath = os.path.join(location, projectName)
|
113
|
-
|
114
|
-
# JMRT: Right now the project.create function change the current
|
115
|
-
# working dir (cwd) to the project location, let's store the cwd
|
116
|
-
# and restored after the creation
|
117
|
-
cwd = os.getcwd()
|
118
|
-
project = Project(pw.Config.getDomain(), projectPath)
|
119
|
-
project.create(runsView=runsView,
|
120
|
-
hostsConf=hostsConf,
|
121
|
-
protocolsConf=protocolsConf,
|
122
|
-
comment=comment)
|
123
|
-
# If location is not the default one create a symlink on self.PROJECTS directory
|
124
|
-
if projectPath != self.getProjectPath(projectName):
|
125
|
-
# JMRT: Let's create the link to the absolute path, since relative
|
126
|
-
# can be broken in systems with different mount points
|
127
|
-
pw.utils.createAbsLink(os.path.abspath(projectPath),
|
128
|
-
self.getProjectPath(projectName))
|
129
|
-
|
130
|
-
os.chdir(cwd) # Restore cwd before project creation
|
131
|
-
|
132
|
-
return project
|
133
|
-
|
134
|
-
def importProject(self, fromLocation, copyFiles=True, projectName=None, searchLocation=None):
|
135
|
-
""" Import a project that is somewhere else in the FS
|
136
|
-
Folder can be copied (default) or linked
|
137
|
-
Optionally a name can be specified, otherwise name will match location folder name
|
138
|
-
Project will always be created in the default project folder.
|
139
|
-
"""
|
140
|
-
# If projectName is None...
|
141
|
-
if projectName is None:
|
142
|
-
# use same name as the import location
|
143
|
-
projectName = os.path.basename(fromLocation)
|
144
|
-
|
145
|
-
projectPath = self.getProjectPath(projectName)
|
146
|
-
|
147
|
-
# If need to copyFiles
|
148
|
-
if copyFiles:
|
149
|
-
# Copy the whole folder
|
150
|
-
pw.utils.copyTree(os.path.abspath(fromLocation), os.path.abspath(projectPath))
|
151
|
-
|
152
|
-
else:
|
153
|
-
# Link the folder
|
154
|
-
pw.utils.createAbsLink(os.path.abspath(fromLocation), projectPath)
|
155
|
-
|
156
|
-
project = self.loadProject(projectName)
|
157
|
-
|
158
|
-
if searchLocation:
|
159
|
-
project.fixLinks(searchLocation)
|
160
|
-
|
161
|
-
return project
|
162
|
-
|
163
|
-
def loadProject(self, projId, **kwargs):
|
164
|
-
""" Retrieve a project object, given its id. """
|
165
|
-
project = Project(pw.Config.getDomain(), self.getProjectPath(projId))
|
166
|
-
project.load(**kwargs)
|
167
|
-
return project
|
168
|
-
|
169
|
-
def deleteProject(self, projectName):
|
170
|
-
pw.utils.cleanPath(self.getProjectPath(projectName))
|
171
|
-
|
172
|
-
def renameProject(self, oldName, newName):
|
173
|
-
os.rename(self.getProjectPath(oldName), self.getProjectPath(newName))
|
174
|
-
|
175
|
-
def hasProject(self, projectName):
|
176
|
-
"""Return True if exists a project with projectName"""
|
177
|
-
for projInfo in self.listProjects():
|
178
|
-
if projectName == projInfo.projName:
|
179
|
-
return True
|
180
|
-
return False
|