Skip to content

Commit cc526ab

Browse files
committed
处理权限问题
1 parent 57ad7c4 commit cc526ab

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

aipyapp/aipy/task.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ def __init__(self, manager: TaskManager, data: TaskData | None = None):
121121
plugins[plugin_name] = plugin
122122
self.plugins = plugins
123123

124+
@property
125+
def instruction(self):
126+
return self.steps[0]['instruction'] if self.steps else None
127+
124128
def emit(self, event_name: str, **kwargs):
125129
event = self.event_bus.emit(event_name, **kwargs)
126130
if self.steps:
@@ -237,7 +241,7 @@ def done(self):
237241
self.log.warning('Task not saved, trying to save')
238242
self._auto_save()
239243

240-
newname = get_safe_filename(self.steps[0]['instruction'], extension=None)
244+
newname = get_safe_filename(self.instruction, extension=None)
241245
if newname:
242246
try:
243247
os.rename(curname, newname)

aipyapp/res/prompts/client.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- commands 字典,全局变量,命令及其版本
66
#}
77
<user_computer>
8-
Code blocks will be executed on this user computer:
8+
Code blocks will be executed on this user computer and have full access to the user computer:
99

1010
<os>
1111
System: {{ os.system }}

0 commit comments

Comments
 (0)