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