Searching the Help
To search for information in the Help, type a word or phrase in the Search box. When you enter a group of words, OR is inferred. You can use Boolean operators to refine your search.
Results returned are case insensitive. However, results ranking takes case into account and assigns higher scores to case matches. Therefore, a search for "cats" followed by a search for "Cats" would return the same number of Help topics, but the order in which the topics are listed would be different.
Search for | Example | Results |
---|---|---|
A single word | cat
|
Topics that contain the word "cat". You will also find its grammatical variations, such as "cats". |
A phrase. You can specify that the search results contain a specific phrase. |
"cat food" (quotation marks) |
Topics that contain the literal phrase "cat food" and all its grammatical variations. Without the quotation marks, the query is equivalent to specifying an OR operator, which finds topics with one of the individual words instead of the phrase. |
Search for | Operator | Example |
---|---|---|
Two or more words in the same topic |
|
|
Either word in a topic |
|
|
Topics that do not contain a specific word or phrase |
|
|
Topics that contain one string and do not contain another | ^ (caret) |
cat ^ mouse
|
A combination of search types | ( ) parentheses |
|
- Create Jython Code
- Use External Java JAR Files within Jython
- Execution of the Code
- Modifying Out-of-the-Box Scripts
- Structure of the Jython File
- Results Generation by the Jython Script
- The Framework Instance
- Finding the Correct Credentials (for Connection Adapters)
- Handling Exceptions from Java
- Troubleshooting Migration from Jython Version 2.1 to 2.5.3
Troubleshooting Migration from Jython Version 2.1 to 2.5.3
Universal Discovery now uses Jython version 2.5.3. All out-of-the-box scripts have been properly migrated. If you developed your own Jython scripts prior to this upgrade for use by Discovery, you may run into the following issues and have to make the fixes indicated.
Note You must be an experienced Jython developer to make these changes.
- Error message:
TypeError: int argument required
- Possible cause: Using string formatting to decimal integer from string variable containing integer data.
-
Problematic Jython 2.1 code:
variable = "43"
print "%d" % variable
-
Correct Jython 2.5.3 code:
variable = "43"
print "%s" % variable
or
variable = "43"
print "%d" % int(variable)
The code below may not work correctly if input contains Unicode strings:
- Problematic Jython 2.1 code:
isinstance(unicodeStringVariable,'')
-
Correct Jython 2.5.3 code:
isinstance(unicodeStringVariable,basestring)
The comparison should be done with
basestring
to test whether an object is an instance ofstr
or Unicode.
- Error Message:
SyntaxError: Non-ASCII character in file 'x', , but no encoding declared; see http://www.python.org/peps/pep-0263.html for details -
Correct Jython 2.5.3 code: (add this to the first line in the file)
# coding: utf-8
- Error message:
AttributeError: 'module' object has no attribute 'sub_package_name'
- Possible cause: A sub-package is imported without explicitly specifying the name of sub-package in the import statement.
-
Problematic Jython 2.1 code:
import a
print dir(a.b)
The sub-package is not explicitly imported.
-
Correct Jython 2.5.3 code:
import a.b
or
from a import b
Starting from Jython 2.2, the __iter__ method is used to loop over a collection in the scope of a for-in block. The iterator should implement the next method, returning an appropriate element or throw the StopIteration error if it reached the end of the collection. If the __iter__ method is not implemented, the getitem method is used instead.
- Jython 2.1 method for raising exceptions is obsolete:
raise Exception, 'Failed getting contents of file'
- Recommended Jython 2.5.3 method for raising exceptions:
raise Exception('Failed getting contents of file')
We welcome your comments!
To open the configured email client on this computer, open an email window.
Otherwise, copy the information below to a web mail client, and send this email to ovdoc-asm@hpe.com.
Help Topic ID:
Product:
Topic Title:
Feedback: