Skip to content

Commit a27ca65

Browse files
OhYeeclaude
andcommitted
style(sandbox): 应用 pyink 行宽规则
__get_client(config=config) 链式调用超过行宽,需要折行。仅为格式调整, 不改变运行时行为。 Change-Id: Ie74ebdffd6f7f9dec413b60b195d3a019433e258 Co-developed-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5ec3df6 commit a27ca65

2 files changed

Lines changed: 33 additions & 11 deletions

File tree

agentrun/sandbox/__sandbox_async_template.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ async def create_async(
180180
)
181181

182182
# 创建 Sandbox(返回基类实例)
183-
base_sandbox = await cls.__get_client(config=config).create_sandbox_async(
183+
base_sandbox = await cls.__get_client(
184+
config=config
185+
).create_sandbox_async(
184186
template_name=template_name,
185187
sandbox_idle_timeout_seconds=sandbox_idle_timeout_seconds,
186188
sandbox_id=sandbox_id,
@@ -269,7 +271,9 @@ async def list_async(
269271
Returns:
270272
ListSandboxesOutput: Sandbox 列表结果
271273
"""
272-
return await cls.__get_client(config=config).list_sandboxes_async(input, config)
274+
return await cls.__get_client(config=config).list_sandboxes_async(
275+
input, config
276+
)
273277

274278
@classmethod
275279
@overload

agentrun/sandbox/sandbox.py

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,9 @@ async def create_async(
250250
)
251251

252252
# 创建 Sandbox(返回基类实例)
253-
base_sandbox = await cls.__get_client(config=config).create_sandbox_async(
253+
base_sandbox = await cls.__get_client(
254+
config=config
255+
).create_sandbox_async(
254256
template_name=template_name,
255257
sandbox_idle_timeout_seconds=sandbox_idle_timeout_seconds,
256258
sandbox_id=sandbox_id,
@@ -394,7 +396,9 @@ def stop_by_id(cls, sandbox_id: str, config: Optional[Config] = None):
394396
"""
395397
if sandbox_id is None:
396398
raise ValueError("sandbox_id is required")
397-
return cls.__get_client(config=config).stop_sandbox(sandbox_id, config=config)
399+
return cls.__get_client(config=config).stop_sandbox(
400+
sandbox_id, config=config
401+
)
398402

399403
@classmethod
400404
async def delete_by_id_async(
@@ -428,7 +432,9 @@ def delete_by_id(cls, sandbox_id: str, config: Optional[Config] = None):
428432
"""
429433
if sandbox_id is None:
430434
raise ValueError("sandbox_id is required")
431-
return cls.__get_client(config=config).delete_sandbox(sandbox_id, config=config)
435+
return cls.__get_client(config=config).delete_sandbox(
436+
sandbox_id, config=config
437+
)
432438

433439
@classmethod
434440
async def list_async(
@@ -445,7 +451,9 @@ async def list_async(
445451
Returns:
446452
ListSandboxesOutput: Sandbox 列表结果
447453
"""
448-
return await cls.__get_client(config=config).list_sandboxes_async(input, config)
454+
return await cls.__get_client(config=config).list_sandboxes_async(
455+
input, config
456+
)
449457

450458
@classmethod
451459
def list(
@@ -640,7 +648,9 @@ def connect(
640648
raise ValueError("sandbox_id is required")
641649

642650
# 先获取 sandbox 信息
643-
sandbox = cls.__get_client(config=config).get_sandbox(sandbox_id, config=config)
651+
sandbox = cls.__get_client(config=config).get_sandbox(
652+
sandbox_id, config=config
653+
)
644654

645655
resolved_type = template_type
646656
if resolved_type is None:
@@ -714,7 +724,9 @@ def create_template(
714724
"""
715725
if input.template_type is None:
716726
raise ValueError("template_type is required")
717-
return cls.__get_client(config=config).create_template(input, config=config)
727+
return cls.__get_client(config=config).create_template(
728+
input, config=config
729+
)
718730

719731
@classmethod
720732
async def get_template_async(
@@ -750,7 +762,9 @@ def get_template(
750762
"""
751763
if template_name is None:
752764
raise ValueError("template_name is required")
753-
return cls.__get_client(config=config).get_template(template_name, config=config)
765+
return cls.__get_client(config=config).get_template(
766+
template_name, config=config
767+
)
754768

755769
@classmethod
756770
async def update_template_async(
@@ -832,7 +846,9 @@ def delete_template(
832846
"""
833847
if template_name is None:
834848
raise ValueError("template_name is required")
835-
return cls.__get_client(config=config).delete_template(template_name, config=config)
849+
return cls.__get_client(config=config).delete_template(
850+
template_name, config=config
851+
)
836852

837853
@classmethod
838854
async def list_templates_async(
@@ -868,7 +884,9 @@ def list_templates(
868884
Returns:
869885
List[Template]: Template 列表
870886
"""
871-
return cls.__get_client(config=config).list_templates(input, config=config)
887+
return cls.__get_client(config=config).list_templates(
888+
input, config=config
889+
)
872890

873891
async def get_async(self):
874892
if self.sandbox_id is None:

0 commit comments

Comments
 (0)