Skip to content
Snippets Groups Projects
Commit 0b92ed73 authored by Michi Hostettler's avatar Michi Hostettler :coffee:
Browse files

review comments; remove >>> prompts from examples

parent 80d42d49
No related branches found
No related tags found
1 merge request!32provide import system access through context manager
Pipeline #1653679 passed
......@@ -58,8 +58,8 @@ Finally, from your code, you can start a JVM with the complete list of jars
using:
```python
>>> mgr = cmmnbuild_dep_manager.Manager()
>>> jpype = mgr.start_jpype_jvm()
mgr = cmmnbuild_dep_manager.Manager()
jpype = mgr.start_jpype_jvm()
```
At this stage, JPype is ready to use.
......@@ -67,7 +67,6 @@ At this stage, JPype is ready to use.
To enable the JPype (>= 0.7) import system, you can use the `imports()` context manager:
```python
mgr = cmmnbuild_dep_manager.Manager()
mgr.start_jpype_jvm()
with mgr.imports():
from cern.some.service import Service
# ...
......@@ -94,8 +93,8 @@ Helper functions are provided to inspect the classes in the downloaded jars.
Provides a listing of all classes contained within the jars:
```python
>>> mgr = cmmnbuild_dep_manager.Manager()
>>> mgr.class_list()
mgr = cmmnbuild_dep_manager.Manager()
mgr.class_list()
['cern.accsoft.cals.extr.client.commandline.CommandLineException',
'cern.accsoft.cals.extr.client.commandline.CommandLineServiceBuilder',
'cern.accsoft.cals.extr.client.commandline.CommandMethod',
......@@ -108,8 +107,8 @@ Provides a listing of all classes contained within the jars:
Search for any class by name:
```python
>>> mgr = cmmnbuild_dep_manager.Manager()
>>> mgr.class_search('ServiceBuilder')
mgr = cmmnbuild_dep_manager.Manager()
mgr.class_search('ServiceBuilder')
['cern.accsoft.cals.extr.client.commandline.CommandLineServiceBuilder',
'cern.accsoft.cals.extr.client.service.ServiceBuilder',
'cern.cmw.rda3.client.service.ClientServiceBuilder',
......@@ -121,15 +120,15 @@ Search for any class by name:
Provide a pasteable example of how to use a specific class from Python:
```python
>>> mgr = cmmnbuild_dep_manager.Manager()
>>> mgr.class_hints('cern.accsoft.cals.extr.client.service.ServiceBuilder')
mgr = cmmnbuild_dep_manager.Manager()
mgr.class_hints('cern.accsoft.cals.extr.client.service.ServiceBuilder')
cern = jpype.JPackage('cern')
ServiceBuilder = cern.accsoft.cals.extr.client.service.ServiceBuilder
>>> jpype = mgr.start_jpype_jvm()
>>> cern = jpype.JPackage('cern')
>>> ServiceBuilder = cern.accsoft.cals.extr.client.service.ServiceBuilder
>>> ServiceBuilder
jpype = mgr.start_jpype_jvm()
cern = jpype.JPackage('cern')
ServiceBuilder = cern.accsoft.cals.extr.client.service.ServiceBuilder
ServiceBuilder
jpype._jclass.cern.accsoft.cals.extr.client.service.ServiceBuilder
```
......@@ -153,8 +152,8 @@ pyjapc
Which is equivalent to the following Python code:
```python
>>> mgr = cmmnbuild_dep_manager.Manager()
>>> mgr.register('pytimber', 'pyjapc')
mgr = cmmnbuild_dep_manager.Manager()
mgr.register('pytimber', 'pyjapc')
('pytimber', 'pyjapc')
```
......@@ -168,8 +167,8 @@ cmmnbuild_dep_manager manager directly. For example, manual installation of
a package can be achieved with:
```python
>>> mgr = cmmnbuild_dep_manager.Manager()
>>> mgr.install('pyjapc')
mgr = cmmnbuild_dep_manager.Manager()
mgr.install('pyjapc')
```
The `install()` function registers the package and resolves the dependencies
......@@ -203,8 +202,8 @@ class PyJapc:
Then the user executing:
```python
>>> import pyjapc
>>> japc = pyjapc.PyJapc()
import pyjapc
japc = pyjapc.PyJapc()
```
will cause the jars to be downloaded if they aren't already existing on disk
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment