Skip to content

Commit 4634058

Browse files
committed
ruff
1 parent cf9dc8e commit 4634058

11 files changed

Lines changed: 410 additions & 738 deletions

File tree

rsrc/schema_gen/_icommence.py

Lines changed: 200 additions & 357 deletions
Large diffs are not rendered by default.

rsrc/schema_gen/generated_pydantic_api.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,7 @@ class ComLibraryApi(BaseModel):
243243
field__init__: FieldInit | None = PField(None, alias='__init__')
244244
field__del__: dict[str, Any] | None = PField(None, alias='__del__')
245245
close: dict[str, Any] | None = None
246-
field_query_interface_: FieldQueryInterface | None = PField(
247-
None, alias='_query_interface_'
248-
)
246+
field_query_interface_: FieldQueryInterface | None = PField(None, alias='_query_interface_')
249247
OnLoad: dict[str, Any] | None = None
250248
OnSave: dict[str, Any] | None = None
251249
OnCancel: dict[str, Any] | None = None

rsrc/schema_gen/play.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ def parse_python_com_code(file_path=COM_DEFINITION):
2222
method_name = match.group(1)
2323
parameters = match.group(2)
2424
if parameters:
25-
params = [param.strip().split('=')[0].strip() for param in parameters.split(',') if
26-
param.strip()]
25+
params = [param.strip().split('=')[0].strip() for param in parameters.split(',') if param.strip()]
2726
else:
2827
params = []
2928
methods[method_name] = params
@@ -35,7 +34,7 @@ def generate_json_schema(reflection_data, com_methods):
3534
'$schema': 'http://json-schema.org/draft-07/schema#',
3635
'title': 'COM Library API',
3736
'type': 'object',
38-
'properties': {}
37+
'properties': {},
3938
}
4039
for method_name, params in com_methods.items():
4140
method_info = reflection_data.get(method_name, {})
@@ -46,8 +45,8 @@ def generate_json_schema(reflection_data, com_methods):
4645
'required': params,
4746
'return': {
4847
'type': 'string',
49-
'description': f'Returns a result from {method_name}' # Simplistic assumption
50-
}
48+
'description': f'Returns a result from {method_name}', # Simplistic assumption
49+
},
5150
}
5251
return schema
5352

@@ -63,4 +62,4 @@ def generate_json_schema(reflection_data, com_methods):
6362

6463

6564
# # pprint(parse_python_com_code(), indent=4)
66-
# pprint(load_reflection_data(), indent=4)
65+
# pprint(load_reflection_data(), indent=4)

src/pycommence/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
'MoreAvailable',
1010
'pycommence_context',
1111
'pycommences_context',
12-
]
12+
]

src/pycommence/exceptions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ class Handle(StrEnum):
5959

6060
class HasRowCount(Protocol):
6161
@property
62-
def row_count(self) -> int:
63-
...
62+
def row_count(self) -> int: ...
6463

6564

6665
def raise_for_one(res: HasRowCount):

src/pycommence/pycmc_types.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,3 @@ def next_page(self):
254254

255255
def prev_page(self):
256256
return Pagination(offset=max(0, self.offset - self.limit), limit=self.limit)
257-
258-
259-

src/pycommence/pycommence.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,3 @@ def pycommences_context(csrnames: list[str]) -> _t.Generator[PyCommence, None, N
243243
pyc.set_csr(csrname)
244244
yield pyc
245245
CoUninitialize()
246-
247-
248-

0 commit comments

Comments
 (0)