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.
Files changed (127) hide show
  1. pyworkflow/config.py +131 -67
  2. pyworkflow/constants.py +12 -2
  3. pyworkflow/object.py +3 -2
  4. pyworkflow/plugin.py +93 -44
  5. pyworkflow/project/scripts/fix_links.py +4 -1
  6. pyworkflow/resources/showj/arrowDown.png +0 -0
  7. pyworkflow/resources/showj/arrowUp.png +0 -0
  8. pyworkflow/resources/showj/background_section.png +0 -0
  9. pyworkflow/resources/showj/colRowModeOff.png +0 -0
  10. pyworkflow/resources/showj/colRowModeOn.png +0 -0
  11. pyworkflow/resources/showj/delete.png +0 -0
  12. pyworkflow/resources/showj/doc_icon.png +0 -0
  13. pyworkflow/resources/showj/download_icon.png +0 -0
  14. pyworkflow/resources/showj/enabled_gallery.png +0 -0
  15. pyworkflow/resources/showj/galleryViewOff.png +0 -0
  16. pyworkflow/resources/showj/galleryViewOn.png +0 -0
  17. pyworkflow/resources/showj/goto.png +0 -0
  18. pyworkflow/resources/showj/menu.png +0 -0
  19. pyworkflow/resources/showj/separator.png +0 -0
  20. pyworkflow/resources/showj/tableViewOff.png +0 -0
  21. pyworkflow/resources/showj/tableViewOn.png +0 -0
  22. pyworkflow/resources/showj/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  23. pyworkflow/resources/showj/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  24. pyworkflow/resources/showj/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  25. pyworkflow/resources/showj/volumeOff.png +0 -0
  26. pyworkflow/resources/showj/volumeOn.png +0 -0
  27. pyworkflow/viewer.py +23 -1
  28. pyworkflowtests/objects.py +2 -2
  29. pyworkflowtests/protocols.py +1 -3
  30. {scipion_pyworkflow-3.10.5.dist-info → scipion_pyworkflow-3.11.0.dist-info}/METADATA +21 -25
  31. scipion_pyworkflow-3.11.0.dist-info/RECORD +71 -0
  32. {scipion_pyworkflow-3.10.5.dist-info → scipion_pyworkflow-3.11.0.dist-info}/WHEEL +1 -1
  33. scipion_pyworkflow-3.11.0.dist-info/entry_points.txt +2 -0
  34. pyworkflow/apps/__init__.py +0 -29
  35. pyworkflow/apps/pw_manager.py +0 -37
  36. pyworkflow/apps/pw_plot.py +0 -51
  37. pyworkflow/apps/pw_project.py +0 -113
  38. pyworkflow/apps/pw_protocol_list.py +0 -143
  39. pyworkflow/apps/pw_protocol_run.py +0 -51
  40. pyworkflow/apps/pw_run_tests.py +0 -267
  41. pyworkflow/apps/pw_schedule_run.py +0 -322
  42. pyworkflow/apps/pw_sleep.py +0 -37
  43. pyworkflow/apps/pw_sync_data.py +0 -439
  44. pyworkflow/apps/pw_viewer.py +0 -78
  45. pyworkflow/gui/__init__.py +0 -36
  46. pyworkflow/gui/browser.py +0 -726
  47. pyworkflow/gui/canvas.py +0 -1190
  48. pyworkflow/gui/dialog.py +0 -977
  49. pyworkflow/gui/form.py +0 -2637
  50. pyworkflow/gui/graph.py +0 -247
  51. pyworkflow/gui/graph_layout.py +0 -271
  52. pyworkflow/gui/gui.py +0 -566
  53. pyworkflow/gui/matplotlib_image.py +0 -233
  54. pyworkflow/gui/plotter.py +0 -247
  55. pyworkflow/gui/project/__init__.py +0 -25
  56. pyworkflow/gui/project/base.py +0 -192
  57. pyworkflow/gui/project/constants.py +0 -139
  58. pyworkflow/gui/project/labels.py +0 -205
  59. pyworkflow/gui/project/project.py +0 -492
  60. pyworkflow/gui/project/searchprotocol.py +0 -154
  61. pyworkflow/gui/project/searchrun.py +0 -181
  62. pyworkflow/gui/project/steps.py +0 -171
  63. pyworkflow/gui/project/utils.py +0 -332
  64. pyworkflow/gui/project/variables.py +0 -179
  65. pyworkflow/gui/project/viewdata.py +0 -472
  66. pyworkflow/gui/project/viewprojects.py +0 -510
  67. pyworkflow/gui/project/viewprotocols.py +0 -2093
  68. pyworkflow/gui/project/viewprotocols_extra.py +0 -560
  69. pyworkflow/gui/text.py +0 -771
  70. pyworkflow/gui/tooltip.py +0 -185
  71. pyworkflow/gui/tree.py +0 -684
  72. pyworkflow/gui/widgets.py +0 -307
  73. pyworkflow/mapper/__init__.py +0 -26
  74. pyworkflow/mapper/mapper.py +0 -222
  75. pyworkflow/mapper/sqlite.py +0 -1578
  76. pyworkflow/mapper/sqlite_db.py +0 -145
  77. pyworkflow/project/__init__.py +0 -31
  78. pyworkflow/project/config.py +0 -454
  79. pyworkflow/project/manager.py +0 -180
  80. pyworkflow/project/project.py +0 -2010
  81. pyworkflow/protocol/__init__.py +0 -38
  82. pyworkflow/protocol/bibtex.py +0 -48
  83. pyworkflow/protocol/constants.py +0 -87
  84. pyworkflow/protocol/executor.py +0 -455
  85. pyworkflow/protocol/hosts.py +0 -313
  86. pyworkflow/protocol/launch.py +0 -270
  87. pyworkflow/protocol/package.py +0 -42
  88. pyworkflow/protocol/params.py +0 -741
  89. pyworkflow/protocol/protocol.py +0 -2582
  90. pyworkflow/tests/__init__.py +0 -29
  91. pyworkflow/tests/test_utils.py +0 -25
  92. pyworkflow/tests/tests.py +0 -341
  93. pyworkflow/utils/__init__.py +0 -38
  94. pyworkflow/utils/dataset.py +0 -414
  95. pyworkflow/utils/echo.py +0 -104
  96. pyworkflow/utils/graph.py +0 -169
  97. pyworkflow/utils/log.py +0 -284
  98. pyworkflow/utils/path.py +0 -528
  99. pyworkflow/utils/process.py +0 -132
  100. pyworkflow/utils/profiler.py +0 -92
  101. pyworkflow/utils/progressbar.py +0 -154
  102. pyworkflow/utils/properties.py +0 -631
  103. pyworkflow/utils/reflection.py +0 -129
  104. pyworkflow/utils/utils.py +0 -879
  105. pyworkflow/utils/which.py +0 -229
  106. pyworkflow/webservices/__init__.py +0 -8
  107. pyworkflow/webservices/config.py +0 -11
  108. pyworkflow/webservices/notifier.py +0 -162
  109. pyworkflow/webservices/repository.py +0 -59
  110. pyworkflow/webservices/workflowhub.py +0 -74
  111. pyworkflowtests/tests/__init__.py +0 -0
  112. pyworkflowtests/tests/test_canvas.py +0 -72
  113. pyworkflowtests/tests/test_domain.py +0 -45
  114. pyworkflowtests/tests/test_logs.py +0 -74
  115. pyworkflowtests/tests/test_mappers.py +0 -392
  116. pyworkflowtests/tests/test_object.py +0 -507
  117. pyworkflowtests/tests/test_project.py +0 -42
  118. pyworkflowtests/tests/test_protocol_execution.py +0 -135
  119. pyworkflowtests/tests/test_protocol_export.py +0 -78
  120. pyworkflowtests/tests/test_protocol_output.py +0 -158
  121. pyworkflowtests/tests/test_streaming.py +0 -47
  122. pyworkflowtests/tests/test_utils.py +0 -210
  123. scipion_pyworkflow-3.10.5.dist-info/RECORD +0 -140
  124. scipion_pyworkflow-3.10.5.dist-info/dependency_links.txt +0 -1
  125. scipion_pyworkflow-3.10.5.dist-info/entry_points.txt +0 -5
  126. {scipion_pyworkflow-3.10.5.dist-info → scipion_pyworkflow-3.11.0.dist-info/licenses}/LICENSE.txt +0 -0
  127. {scipion_pyworkflow-3.10.5.dist-info → scipion_pyworkflow-3.11.0.dist-info}/top_level.txt +0 -0
@@ -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