Trees | Indices | Help |
|
---|
|
object --+ | infra.mmobject.MmObject --+ | Project
Class to handle Maestro Projects. This is largely a wrapper to the underlying C library which stores all the state information.
The Project class allows selection of rows in the project via various interfaces.
A Maestro project may be accessed from within a Maestro session which has it open via maestro.project_table_get().
A Maestro project may alternatively be accessed without Maestro running by specifying a the name of the project when creating a project object.
See the doc string for the module for more details.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
ProjectRow |
|
||
|
|||
bool |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
list of str |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
ProjectRow |
|
||
|
|||
|
|||
bool |
|
||
int |
|
||
Inherited from Inherited from |
|
|||
|
|||
|
|||
|
|||
|
|
|||
_instances =
|
|||
_debug = False hash(x) |
|
|||
shortname Get the short project name (without the path) |
|||
fullname Get the full name of the project (including the path) |
|||
all_rows Iterator for all rows in the project using the visible project table order |
|||
selected_rows Iterator for the selected rows using the visible project table order |
|||
included_rows Iterator for all included rows. |
|||
groups Get the entry groups in the project |
|||
last_added_entry Return a ProjectRow instance for the last entry added to the project |
|||
|
Enable or disable debug output. Use False or True. Sets this for the class, i.e. affects all instances, current and future. |
Enable the specified option. Currently only AUTOMATIC_CACHE_FREEING is available. This will cause any cached entries to be freed automatically after each iteration when using the all_rows iterator. Other iterators do not allow automatic cache freeing to be enabled. |
Disable the specified option. Currently only AUTOMATIC_CACHE_FREEING is available. See enable() for details. |
Construct a Project class object either by opening a project file or using a handle to an already opened project. If a project name is given via project_name, then we open the named project. If a project handle for an already opened project is passed in (via the project_handle argument), then we use that. If neither or both are given, these are errors. Passing in a project name causes manage=True. When a managed instance goes out of scope or is deleted garbage collection is performed. One side effect is that the project is closed. Passing in a project handle causes manage=False. When a non-managed instance goes out of scope or is deleted the project is left open. This is desirable, for example, when you construct a python Project instance using the project handle of Maestro's currently opened project. This allows Maestro to continue working with the opened project after the python Project instance is gone. Otherwise, the project would be closed and Maestro left in an invalid state, thinking that the project was still open. If close_without_cleanup_dialog is given True, then project cleanup dialog will not be shown when closing the project. In this case, it does not launch the project_cleanup as a separate process, but does the cleanup in-process(i.e. blocking) without showing the dialog. By default, close_without_cleanup_dialog is False, this will run the clean up process in separate process with cleanup dialog.
|
A function to delete this object. Required for MmObject interface. |
Close the project immediately. This method is normally not needed and should only be called if garbage collection cannot be relied upon to close the project as normal. This method may be required in unittests to ensure the project is closed before the next test begins. Note that the project cleanup will occur in-process. |
Return full string representation Warning: you cannot create another project instance for a project which is currently open. That is, a project can only be opened by a single process at a time.
|
Return string representation
|
Return mmproj handle. Can be used with mmproj functions.
|
Retrieve a ProjectRow instance based on the entry ID.
|
Return project row object, ProjectRow, for the given entry ID. Same as Project.getRow() except that it raises KeyError instead of returning None if the row does not exist. The entry ID ('entry') can be specified as either an int or a str, and is used to look up the corresponding index into the project. Older versions used to allow look up by entry name and treated an 'entry' argument of type string as an entry name. This is no longer valid and will generate an exception - the unique identifiers in projects are now entry IDs not entry names. If you find your memory usage becoming excessive, you may want to use freeCachedEntries(). See that method's docstring for more information. |
Determine if the project contains the specified entry ID
|
Delete the project row for the given entry ID. For example, del pt[10] |
If running in Maestro, update the project after a change as the user wants to see their changes in the PT. Does not do anything if the manual_update attribute is set to True. |
Returns a list of ProjectRow entries for all rows matching the given criteria. cmp_op should be "<", "<=", ">", ">=", "==", "!=" |
Select rows in the project. @param select_mode: Selection mode. project.ADD - add rows to existing PT selection. project.REPLACE - replace current selection. project.INVERT - invert the PT selection. project.ALL - select all rows in the PT. project.NONE - deselect all rows in the PT. Examples: pt.selectRows(project.REPLACE, entry_ids=[1, 2, 3]) pt.selectRows(project.ALL) pt.selectRows(project.NONE) @type select_mode: int @param entry_ids: List of entry IDs for the rows to select. Example: pt.selectRows(entry_ids=[1, 2, 3]) @type entry_ids: list of ints or list of str @param esl: This is an ESL definition. Example to add to the selection rows that match the ESL: pt.selectRows(ADD, esl="entry_re entry*") @type esl: str @param rows: Project indices for the rows to select (deprecated). Values refer to the values of the ProjectRow.index property. @param rows: tuple or list of ints. @param function: Callback for determining whether a row should be selected or not (deprecated). @type function: callable |
Private method to add rows to selection via user specified function. See the 'function' section in the doc string of the selectRows() method for usage by client code. |
Private method to unselect all entry rows The public API for de-selecting all rows is: Project.selectRows(NONE) |
Private method to select all rows The public API for selecting all rows is: Project.selectRows(ALL) |
Private method to invert all rows in the project The public API for inverting row selection is: Project.selectRows(INVERT) |
Include rows with the given entry IDs in the Workspace, while optionally excluding all other entries.
|
Return an iterator object Allows iteration over the selected entries. To iterate over all entries use: 'for row in xrange(1, len(Project)+1)' OBSOLETE. Use Project.selected_rows instead. If you find your memory usage becoming excessive, you may want to use freeCachedEntries(). See that method's docstring for more information. |
Refresh the project table This is only usable from within Maestro. |
Return a list of the data names of usable properties in this project instance, including properties which were hidden. There are some additional properties, like whether an entry is selected or included, which are not returned by this function. |
Return a list of the data names of vislble properties in this project instance (hidden properties are not included). @rtype = list of strings @return = list of names of the property columns that are currently displayed in the Project Table |
Return a set of data names of properties (including hidden ones) that are common to all selected entries in this project.
|
Frees all entries that are cached. Things like ProjectRow.getStructure(), ProjectRow.structure, ProjectRow.setStructure() will cause entries to be cached. Unless the cache is freed memory usage will grow and can become quite large (if, for example, you are iterating over and retrieving a large number of structures). Note that on some operating systems any memory already allocated within a process is not returned to the system when it is freed. Instead it is simply marked as available to the process and only gets returned to the system when the process exits. Given this you may not see your memory usage decrease after calling this method. However, by calling this method at carefully chosen points you can minimize your memory footprint. If you free the cache, then the next time the above-mentioned methods/properties are invoked they will get and cache the data by fetching it from disk. |
Create a new entry in the Project Table from structure <st> and return the ProjectRow object for the new entry. In rare cases (when your Structure is managed by C code and use of it is no longer needed in python) using copy=False can give better performance. Doing so will make the Structure invalid for further use in your script.
|
Imports all structures from the specified file into the Project Table. wsreplace - whether to replace the Workspace with the last structure in the specified file (default True). creategroups - which of the imported structures are to be grouped. Valid values are "multiple", "all", and "none". This method is only available when used from within Maestro. |
Return the precision of the property.
|
Return whether the column is in fixed area of the Project Table.
|
Return number of columns in fixed area. This does not include always fixed columns (Row, Included, Stars, 2D Structure and Title).
|
|
shortnameGet the short project name (without the path)
|
fullnameGet the full name of the project (including the path)
|
all_rowsIterator for all rows in the project using the visible project table order
|
selected_rowsIterator for the selected rows using the visible project table order
|
included_rowsIterator for all included rows. No specific return order for the rows.
|
groupsGet the entry groups in the project
|
last_added_entryReturn a ProjectRow instance for the last entry added to the project
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Oct 26 00:59:57 2016 | http://epydoc.sourceforge.net |