Skip to content

Commit 0380177

Browse files
committed
[OMCSessionCmd] improve code for getClassNames()
1 parent c2db375 commit 0380177

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

OMPython/OMCSession.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,12 @@ def getNthComponentModification(self, className, comp_id):
265265
# end getClassNames;
266266
def getClassNames(self, className=None, recursive=False, qualified=False, sort=False, builtin=False,
267267
showProtected=False):
268-
value = self._ask(question='getClassNames',
269-
opt=[className] if className else [] + [f'recursive={str(recursive).lower()}',
270-
f'qualified={str(qualified).lower()}',
271-
f'sort={str(sort).lower()}',
272-
f'builtin={str(builtin).lower()}',
273-
f'showProtected={str(showProtected).lower()}']
274-
)
275-
return value
268+
opt = [className] if className else [] + [f'recursive={str(recursive).lower()}',
269+
f'qualified={str(qualified).lower()}',
270+
f'sort={str(sort).lower()}',
271+
f'builtin={str(builtin).lower()}',
272+
f'showProtected={str(showProtected).lower()}']
273+
return self._ask(question='getClassNames', opt=opt)
276274

277275

278276
class OMCSessionZMQ:

0 commit comments

Comments
 (0)