Enhancement and fixes
- UOPY-94 Request to retrieve the UO Server timeout value from UOPY (external story)
- UOPY-95 Calling Subroutine from UO client using Connection Pooling causes session to become unresponsive when entering debugger (external story)
- UOPY-93 Support uopy.File.fileinfo Function like u2py for UD (internal story)
- UOPY-62 Need way to determine version of uopy from inside the module. (internal story)
- UOPY-44 UOPY connection not released when session killed on server (external bug)
- UOPY-96 test_performance.TestPerformance.test_read_named_fields has an error when running in Linux (internal bug)
Enhancements and fixes
- UOPY-41 Prior to this release, uopy returned two values when only one id was sent to
read_named_fields
, and the id was not found in the file. - UOPY-42 This release adds a method to the
uopy.File
object that gets the fileinfo information from the server. - UOPY-43 An issue with the
uopy.connect
method, where turning on connection pooling was only allowed from theuopy.ini
, has been fixed in this release. Passingpooling_on=True
in theuopy.connect
method will properly utilize a connection pooling license if available. - UOPY- 66 Various performance enhancements have been made to the
uopy.File.Read
anduopy.File.Write
methods.
As of uopy 1.2.0, there is a new method to get the fileinfo information for a uopy.File object. It gets the same information as if you were using the MultiValue BASIC FILEINFO function.
Requirements: You must be connected to UniData 8.2.4 or later, or UniVerse 12.2.1 or later to use this feature.
In order to get the fileinfo information, you must call the uopy.File.fileInfoEx method.
Click to expand to see more information!
>>> import uopy
>>> help(uopy.File.fileInfoEx)
Help on function fileInfoEx in module uopy._file:
fileInfoEx(self)
Get information about the specified fileÆs configuration, such as the
fileÆs parameters, its modulus and load, its operating system file name, and its VOC name.
The information returned depends on the file type and the value of the key.
After calling the method fileInfoEx, you can access these attributes to get their values.
isFileVar: 1 if file.variable is a valid file variable; 0 otherwise.
vocName: VOC name of the file.
pathName: Path name of the file.
type: File type: 1 Static hashed | 3 Dynamic hashed | 4 Type 1 | 5 Sequential | 7 Distributed and Multivolume
hashAlg: Hashing algorithm: 2 for GENERAL, 3 for SEQ.NUM.
modulus: Current modulus.
minModulus: Minimum modulus.
groupSize: Group size, in 1-KB units.
largeRecordSize: Large record size.
mergeLoad: Merge load parameter.
splitLoad: Split load parameter.
currentLoad: Current loading of the file (%).
nodeName: Empty string if the file resides on the local system. Otherwise, the name of the node where the file resides.
isAKFile: 1 if secondary indexes exist on the file; 0 otherwise.
currentLine: Current line number.
partNum: For a distributed file, returns the list of currently open part numbers.
fileStatus: For a distributed file, returns the list of status codes indicating whether the last I/O operation succeeded
or failed for each part. A value of û1 indicates the corresponding part file is not open.
recoveryType: 1 if the file is marked as recoverable, 0 if it is not. Returns an empty string
if recovery is not supported on the file type (such as type 1 and type 19 files).
recoveryId: Always returns an empty string.
isFixedModulus: Always returns 0.
nlsmap: If NLS is enabled, the file map name; otherwise an empty string.
If the map name is the default specified in the uvconfig file, the returned string is the map name followed by the name of the configurable parameter in parentheses.
encryption: Returns a dynamic array containing the following information:
\u25aa For a file encrypted with the WHOLERECORD option:
-1@VM@VM
\u25aa For a file encrypted at the field level:
@VM@VM
@VM[@FM
...@VM]
\u25aa Returns an empty string if the file is not encrypted.
repStatus: Return values can be:
0 û The file is not published, subscribed, or subwriteable.
1 û The file is being published.
2 û The file is being subscribed.
3 û The file is subwriteable.
Note: If U2 Data Replication is not running, this function
returns 0 for any file used with this function.
Args: void
Returns: void
Raise:
UOError
Examples:
>>> f = uopy.File('TEST')
>>> f.fileInfoEx()
>>> print(f.vocName)
>>> print(f.pathName)
>>> print(f.groupSize)
If you plan on using the new uopy.File.fileInfoEx method in your code, it is recommended that you check the version of uopy on the client, and the version of U2 on the server you are connecting to.
One way to check that the correct version of uopy is installed on the client is using the pkg_resources module.
Note that there are other ways to get this information, but these have Python version requirements.
>>> import uopy
>>> import pkg_resources
>>> pkg_resources.get_distribution("uopy").version
'1.2.0'
In order to get the fileInfo information using the uopy.File.fileInfoEx method, you must be connected to UniData 8.2.4 or UniVerse 12.2.1.
If you are on a prior release, the method will raise an uopy.UOError exception: For example:
Error [30096] : Unsupported Server Operation. This operation is not supported at this release of the server. : fileInfoEx is not supported on versions prior to UniData 8.2.4 or prior to UniVerse 12.2.1.
Enhancement
- UOPY-38 UOPY's DynArray class should support concatenation operations like Python list
- Initial release