Skip to content

Commit eb79195

Browse files
authored
Merge pull request #141 from unihd-cag/issue-140
Ignore missing objType when printing objects
2 parents bbf6991 + 7bc9009 commit eb79195

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

skillbridge/client/objects.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ def skill_parent_type(self) -> str:
5151

5252
@property
5353
def skill_type(self) -> Optional[str]:
54-
typ = self.obj_type
54+
try:
55+
typ = self.obj_type
56+
except RuntimeError:
57+
return None
5558
if typ is None:
5659
return None
5760
if isinstance(typ, Symbol):

skillbridge/client/translator.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,14 @@ def encode_call(func_name: str, *args: Skill, **kwargs: Skill) -> SkillCode:
118118

119119
@staticmethod
120120
def encode_dir(obj: SkillCode) -> SkillCode:
121-
parts = ' '.join((f'{obj}->?', f'{obj}->systemHandleNames', f'{obj}->userHandleNames'))
121+
122+
parts = ' '.join(
123+
(
124+
f'{obj}->?',
125+
f"if( type({obj}) == 'rodObj then {obj}->systemHandleNames)",
126+
f'if( type({obj}) == \'rodObj then {obj}->userHandleNames)',
127+
)
128+
)
122129
code = f'mapcar(lambda((attr) sprintf(nil "%s" attr)) nconc({parts}))'
123130
return SkillCode(code)
124131

skillbridge/server/python_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class SingleUnixServer(UnixStreamServer):
7171
allow_reuse_address = True
7272

7373
def __init__(self, file: str, handler: Type[BaseRequestHandler]) -> None:
74-
self.path = f'/tmp/skill-server-' + file + '.sock'
74+
self.path = f'/tmp/skill-server-{file}.sock'
7575
try:
7676
unlink(self.path)
7777
except FileNotFoundError:

0 commit comments

Comments
 (0)