Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Gaudi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gaudi
Gaudi
Commits
e2d74c39
Commit
e2d74c39
authored
4 years ago
by
Marco Clemencic
Browse files
Options
Downloads
Patches
Plain Diff
use cppyy.nullptr instead of None
parent
8d90e658
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1116
Fixes for new ROOT/cppyy
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GaudiPython/python/GaudiPython/Bindings.py
+15
-31
15 additions, 31 deletions
GaudiPython/python/GaudiPython/Bindings.py
with
15 additions
and
31 deletions
GaudiPython/python/GaudiPython/Bindings.py
+
15
−
31
View file @
e2d74c39
...
...
@@ -145,7 +145,7 @@ class InterfaceCast(object):
"
for object
"
,
obj
)
import
traceback
traceback
.
print_stack
()
return
None
return
cppyy
.
nullptr
cast
=
__call__
...
...
@@ -260,18 +260,11 @@ class PropertyEntry(object):
class
iProperty
(
object
):
"""
Python equivalent to the C++ Property interface
"""
def
__init__
(
self
,
name
,
ip
=
None
):
if
ip
:
self
.
__dict__
[
'
_ip
'
]
=
InterfaceCast
(
gbl
.
IProperty
)(
ip
)
else
:
self
.
__dict__
[
'
_ip
'
]
=
None
def
__init__
(
self
,
name
,
ip
=
cppyy
.
nullptr
):
self
.
__dict__
[
'
_ip
'
]
=
InterfaceCast
(
gbl
.
IProperty
)(
ip
)
self
.
__dict__
[
'
_svcloc
'
]
=
gbl
.
Gaudi
.
svcLocator
()
optsvc
=
Helper
.
service
(
self
.
_svcloc
,
'
JobOptionsSvc
'
)
if
optsvc
:
self
.
__dict__
[
'
_optsvc
'
]
=
InterfaceCast
(
gbl
.
IJobOptionsSvc
)(
optsvc
)
else
:
self
.
__dict__
[
'
_optsvc
'
]
=
None
self
.
__dict__
[
'
_optsvc
'
]
=
InterfaceCast
(
gbl
.
IJobOptionsSvc
)(
optsvc
)
self
.
__dict__
[
'
_name
'
]
=
name
def
getInterface
(
self
):
...
...
@@ -373,12 +366,9 @@ class iProperty(object):
class
iService
(
iProperty
):
"""
Python equivalent to IProperty interface
"""
def
__init__
(
self
,
name
,
isvc
=
None
):
def
__init__
(
self
,
name
,
isvc
=
cppyy
.
nullptr
):
iProperty
.
__init__
(
self
,
name
,
isvc
)
if
isvc
:
self
.
__dict__
[
'
_isvc
'
]
=
InterfaceCast
(
gbl
.
IService
)(
isvc
)
else
:
self
.
__dict__
[
'
_isvc
'
]
=
None
self
.
__dict__
[
'
_isvc
'
]
=
InterfaceCast
(
gbl
.
IService
)(
isvc
)
def
retrieveInterface
(
self
):
isvc
=
Helper
.
service
(
self
.
_svcloc
,
self
.
_name
)
...
...
@@ -416,12 +406,9 @@ class iService(iProperty):
class
iAlgorithm
(
iProperty
):
"""
Python equivalent to IAlgorithm interface
"""
def
__init__
(
self
,
name
,
ialg
=
None
):
def
__init__
(
self
,
name
,
ialg
=
cppyy
.
nullptr
):
iProperty
.
__init__
(
self
,
name
,
ialg
)
if
ialg
:
self
.
__dict__
[
'
_ialg
'
]
=
InterfaceCast
(
gbl
.
IAlgorithm
)(
ialg
)
else
:
self
.
__dict__
[
'
_ialg
'
]
=
None
self
.
__dict__
[
'
_ialg
'
]
=
InterfaceCast
(
gbl
.
IAlgorithm
)(
ialg
)
def
retrieveInterface
(
self
):
ialg
=
Helper
.
algorithm
(
...
...
@@ -478,12 +465,9 @@ class iAlgorithm(iProperty):
class
iAlgTool
(
iProperty
):
"""
Python equivalent to IAlgTool interface (not completed yet)
"""
def
__init__
(
self
,
name
,
itool
=
None
):
def
__init__
(
self
,
name
,
itool
=
cppyy
.
nullptr
):
iProperty
.
__init__
(
self
,
name
,
itool
)
if
itool
:
self
.
__dict__
[
'
_itool
'
]
=
itool
else
:
self
.
__dict__
[
'
_itool
'
]
=
None
self
.
__dict__
[
'
_itool
'
]
=
itool
svc
=
Helper
.
service
(
self
.
_svcloc
,
'
ToolSvc
'
,
True
)
self
.
__dict__
[
'
_toolsvc
'
]
=
iToolSvc
(
'
ToolSvc
'
,
svc
)
...
...
@@ -531,7 +515,7 @@ class iDataSvc(iService):
def
retrieveObject
(
self
,
path
):
if
not
self
.
_idp
:
return
None
return
cppyy
.
nullptr
return
Helper
.
dataobject
(
self
.
_idp
,
path
)
# get object from TES
...
...
@@ -601,7 +585,7 @@ class iDataSvc(iService):
'
C++ service %s does not exist
'
%
self
.
__dict__
[
'
_name
'
])
return
self
.
unregisterObject
(
path
)
def
leaves
(
self
,
node
=
None
):
def
leaves
(
self
,
node
=
cppyy
.
nullptr
):
if
not
node
:
node
=
self
.
retrieveObject
(
''
)
ll
=
gbl
.
std
.
vector
(
'
IRegistry*
'
)()
...
...
@@ -612,7 +596,7 @@ class iDataSvc(iService):
if
self
.
_idm
.
objectLeaves
(
node
,
ll
).
isSuccess
():
return
ll
def
dump
(
self
,
node
=
None
):
def
dump
(
self
,
node
=
cppyy
.
nullptr
):
if
not
node
:
root
=
self
.
retrieveObject
(
''
)
if
root
:
...
...
@@ -624,7 +608,7 @@ class iDataSvc(iService):
for
l
in
self
.
leaves
(
node
):
self
.
dump
(
l
)
def
getList
(
self
,
node
=
None
,
lst
=
[],
rootFID
=
None
):
def
getList
(
self
,
node
=
cppyy
.
nullptr
,
lst
=
[],
rootFID
=
None
):
if
not
node
:
root
=
self
.
retrieveObject
(
''
)
if
root
:
...
...
@@ -643,7 +627,7 @@ class iDataSvc(iService):
continue
return
lst
def
getHistoNames
(
self
,
node
=
None
,
lst
=
[]):
def
getHistoNames
(
self
,
node
=
cppyy
.
nullptr
,
lst
=
[]):
if
not
node
:
root
=
self
.
retrieveObject
(
''
)
if
root
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment