docs: bump version to 5.0b2 and regenerate documentation
This commit is contained in:
+51
-36
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
||||
<meta name="generator" content="pdoc3 0.11.5">
|
||||
<meta name="generator" content="pdoc3 0.11.6">
|
||||
<title>connpy API documentation</title>
|
||||
<meta name="description" content="Connection manager …">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/13.0.0/sanitize.min.css" integrity="sha512-y1dtMcuvtTMJc1yPgEqF0ZjQbhnc/bFhyvIyVNb9Zk5mIGtqVaAB1Ttl28su8AvFMOY0EwRbAe+HCLqj6W7/KA==" crossorigin>
|
||||
@@ -551,6 +551,13 @@ class Preload:
|
||||
</code></pre>
|
||||
</section>
|
||||
<section>
|
||||
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
|
||||
<dl>
|
||||
<dt><code class="name"><a title="connpy.tests" href="tests/index.html">connpy.tests</a></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
</section>
|
||||
@@ -623,8 +630,8 @@ class Preload:
|
||||
if not (isinstance(node.test, ast.Compare) and
|
||||
isinstance(node.test.left, ast.Name) and
|
||||
node.test.left.id == '__name__' and
|
||||
isinstance(node.test.comparators[0], ast.Str) and
|
||||
node.test.comparators[0].s == '__main__'):
|
||||
((hasattr(ast, 'Str') and isinstance(node.test.comparators[0], getattr(ast, 'Str')) and node.test.comparators[0].s == '__main__') or
|
||||
(hasattr(ast, 'Constant') and isinstance(node.test.comparators[0], getattr(ast, 'Constant')) and node.test.comparators[0].value == '__main__'))):
|
||||
return "Only __name__ == __main__ If is allowed"
|
||||
|
||||
elif not isinstance(node, (ast.FunctionDef, ast.ClassDef, ast.Import, ast.ImportFrom, ast.Pass)):
|
||||
@@ -758,8 +765,8 @@ class Preload:
|
||||
if not (isinstance(node.test, ast.Compare) and
|
||||
isinstance(node.test.left, ast.Name) and
|
||||
node.test.left.id == '__name__' and
|
||||
isinstance(node.test.comparators[0], ast.Str) and
|
||||
node.test.comparators[0].s == '__main__'):
|
||||
((hasattr(ast, 'Str') and isinstance(node.test.comparators[0], getattr(ast, 'Str')) and node.test.comparators[0].s == '__main__') or
|
||||
(hasattr(ast, 'Constant') and isinstance(node.test.comparators[0], getattr(ast, 'Constant')) and node.test.comparators[0].value == '__main__'))):
|
||||
return "Only __name__ == __main__ If is allowed"
|
||||
|
||||
elif not isinstance(node, (ast.FunctionDef, ast.ClassDef, ast.Import, ast.ImportFrom, ast.Pass)):
|
||||
@@ -1217,7 +1224,7 @@ class ai:
|
||||
if isinstance(commands, str):
|
||||
try:
|
||||
commands = json.loads(commands)
|
||||
except:
|
||||
except ValueError:
|
||||
commands = [c.strip() for c in commands.split('\n') if c.strip()]
|
||||
|
||||
# Expand multi-line commands within a list (in case the AI packs them)
|
||||
@@ -1616,9 +1623,10 @@ class ai:
|
||||
response = completion(model=model, messages=safe_messages, tools=[], api_key=key)
|
||||
resp_msg = response.choices[0].message
|
||||
messages.append(resp_msg.model_dump(exclude_none=True))
|
||||
except:
|
||||
pass
|
||||
|
||||
except Exception as e:
|
||||
if status:
|
||||
status.update(f"[bold red]Error fetching summary: {e}[/bold red]")
|
||||
printer.warning(f"Failed to fetch final summary from LLM: {e}")
|
||||
except KeyboardInterrupt:
|
||||
if status: status.update("[bold red]Interrupted! Closing pending tasks...")
|
||||
last_msg = messages[-1]
|
||||
@@ -1631,7 +1639,7 @@ class ai:
|
||||
response = completion(model=model, messages=safe_messages, tools=tools, api_key=key)
|
||||
resp_msg = response.choices[0].message
|
||||
messages.append(resp_msg.model_dump(exclude_none=True))
|
||||
except: pass
|
||||
except Exception: pass
|
||||
finally:
|
||||
try:
|
||||
log_dir = self.config.defaultdir
|
||||
@@ -1641,7 +1649,7 @@ class ai:
|
||||
if os.path.exists(log_path):
|
||||
try:
|
||||
with open(log_path, "r") as f: hist = json.load(f)
|
||||
except: hist = []
|
||||
except (IOError, json.JSONDecodeError): hist = []
|
||||
hist.append({"timestamp": datetime.datetime.now().isoformat(), "roles": {"strategic_engine": self.architect_model, "execution_engine": self.engineer_model}, "session": messages})
|
||||
with open(log_path, "w") as f: json.dump(hist[-10:], f, indent=4)
|
||||
except Exception as e:
|
||||
@@ -1664,7 +1672,7 @@ class ai:
|
||||
<dl>
|
||||
<dt id="connpy.ai.SAFE_COMMANDS"><code class="name">var <span class="ident">SAFE_COMMANDS</span></code></dt>
|
||||
<dd>
|
||||
<div class="desc"></div>
|
||||
<div class="desc"><p>The type of the None singleton.</p></div>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Instance variables</h3>
|
||||
@@ -1925,9 +1933,10 @@ def ask(self, user_input, dryrun=False, chat_history=None, status=None, debug=Fa
|
||||
response = completion(model=model, messages=safe_messages, tools=[], api_key=key)
|
||||
resp_msg = response.choices[0].message
|
||||
messages.append(resp_msg.model_dump(exclude_none=True))
|
||||
except:
|
||||
pass
|
||||
|
||||
except Exception as e:
|
||||
if status:
|
||||
status.update(f"[bold red]Error fetching summary: {e}[/bold red]")
|
||||
printer.warning(f"Failed to fetch final summary from LLM: {e}")
|
||||
except KeyboardInterrupt:
|
||||
if status: status.update("[bold red]Interrupted! Closing pending tasks...")
|
||||
last_msg = messages[-1]
|
||||
@@ -1940,7 +1949,7 @@ def ask(self, user_input, dryrun=False, chat_history=None, status=None, debug=Fa
|
||||
response = completion(model=model, messages=safe_messages, tools=tools, api_key=key)
|
||||
resp_msg = response.choices[0].message
|
||||
messages.append(resp_msg.model_dump(exclude_none=True))
|
||||
except: pass
|
||||
except Exception: pass
|
||||
finally:
|
||||
try:
|
||||
log_dir = self.config.defaultdir
|
||||
@@ -1950,7 +1959,7 @@ def ask(self, user_input, dryrun=False, chat_history=None, status=None, debug=Fa
|
||||
if os.path.exists(log_path):
|
||||
try:
|
||||
with open(log_path, "r") as f: hist = json.load(f)
|
||||
except: hist = []
|
||||
except (IOError, json.JSONDecodeError): hist = []
|
||||
hist.append({"timestamp": datetime.datetime.now().isoformat(), "roles": {"strategic_engine": self.architect_model, "execution_engine": self.engineer_model}, "session": messages})
|
||||
with open(log_path, "w") as f: json.dump(hist[-10:], f, indent=4)
|
||||
except Exception as e:
|
||||
@@ -2123,7 +2132,7 @@ def confirm(self, user_input): return True</code></pre>
|
||||
if isinstance(commands, str):
|
||||
try:
|
||||
commands = json.loads(commands)
|
||||
except:
|
||||
except ValueError:
|
||||
commands = [c.strip() for c in commands.split('\n') if c.strip()]
|
||||
|
||||
# Expand multi-line commands within a list (in case the AI packs them)
|
||||
@@ -2246,7 +2255,7 @@ class configfile:
|
||||
try:
|
||||
with open(pathfile, "r") as f:
|
||||
configdir = f.read().strip()
|
||||
except:
|
||||
except (FileNotFoundError, IOError):
|
||||
with open(pathfile, "w") as f:
|
||||
f.write(str(defaultdir))
|
||||
configdir = defaultdir
|
||||
@@ -2306,7 +2315,8 @@ class configfile:
|
||||
with open(conf, "w") as f:
|
||||
json.dump(newconfig, f, indent = 4)
|
||||
f.close()
|
||||
except:
|
||||
except (IOError, OSError) as e:
|
||||
printer.error(f"Failed to save config: {e}")
|
||||
return 1
|
||||
return 0
|
||||
|
||||
@@ -2391,12 +2401,12 @@ class configfile:
|
||||
if profile:
|
||||
try:
|
||||
newfolder[node_name][key] = self.profiles[profile.group(1)][key]
|
||||
except:
|
||||
except KeyError:
|
||||
newfolder[node_name][key] = ""
|
||||
elif value == '' and key == "protocol":
|
||||
try:
|
||||
newfolder[node_name][key] = self.profiles["default"][key]
|
||||
except:
|
||||
except KeyError:
|
||||
newfolder[node_name][key] = "ssh"
|
||||
|
||||
newfolder = {"{}{}".format(k,unique):v for k,v in newfolder.items()}
|
||||
@@ -2417,12 +2427,12 @@ class configfile:
|
||||
if profile:
|
||||
try:
|
||||
newnode[key] = self.profiles[profile.group(1)][key]
|
||||
except:
|
||||
except KeyError:
|
||||
newnode[key] = ""
|
||||
elif value == '' and key == "protocol":
|
||||
try:
|
||||
newnode[key] = self.profiles["default"][key]
|
||||
except:
|
||||
except KeyError:
|
||||
newnode[key] = "ssh"
|
||||
return newnode
|
||||
|
||||
@@ -2577,12 +2587,12 @@ class configfile:
|
||||
if profile:
|
||||
try:
|
||||
nodes[node][key] = self.profiles[profile.group(1)][key]
|
||||
except:
|
||||
except KeyError:
|
||||
nodes[node][key] = ""
|
||||
elif value == '' and key == "protocol":
|
||||
try:
|
||||
nodes[node][key] = self.profiles["default"][key]
|
||||
except:
|
||||
except KeyError:
|
||||
nodes[node][key] = "ssh"
|
||||
return nodes
|
||||
|
||||
@@ -2780,12 +2790,12 @@ def getitem(self, unique, keys = None, extract = False):
|
||||
if profile:
|
||||
try:
|
||||
newfolder[node_name][key] = self.profiles[profile.group(1)][key]
|
||||
except:
|
||||
except KeyError:
|
||||
newfolder[node_name][key] = ""
|
||||
elif value == '' and key == "protocol":
|
||||
try:
|
||||
newfolder[node_name][key] = self.profiles["default"][key]
|
||||
except:
|
||||
except KeyError:
|
||||
newfolder[node_name][key] = "ssh"
|
||||
|
||||
newfolder = {"{}{}".format(k,unique):v for k,v in newfolder.items()}
|
||||
@@ -2806,12 +2816,12 @@ def getitem(self, unique, keys = None, extract = False):
|
||||
if profile:
|
||||
try:
|
||||
newnode[key] = self.profiles[profile.group(1)][key]
|
||||
except:
|
||||
except KeyError:
|
||||
newnode[key] = ""
|
||||
elif value == '' and key == "protocol":
|
||||
try:
|
||||
newnode[key] = self.profiles["default"][key]
|
||||
except:
|
||||
except KeyError:
|
||||
newnode[key] = "ssh"
|
||||
return newnode</code></pre>
|
||||
</details>
|
||||
@@ -2979,12 +2989,12 @@ class node:
|
||||
if profile and config != '':
|
||||
try:
|
||||
setattr(self,key,config.profiles[profile.group(1)][key])
|
||||
except:
|
||||
except KeyError:
|
||||
setattr(self,key,"")
|
||||
elif attr[key] == '' and key == "protocol":
|
||||
try:
|
||||
setattr(self,key,config.profiles["default"][key])
|
||||
except:
|
||||
except (KeyError, AttributeError):
|
||||
setattr(self,key,"ssh")
|
||||
else:
|
||||
setattr(self,key,attr[key])
|
||||
@@ -3003,12 +3013,12 @@ class node:
|
||||
if profile:
|
||||
try:
|
||||
self.jumphost[key] = config.profiles[profile.group(1)][key]
|
||||
except:
|
||||
except KeyError:
|
||||
self.jumphost[key] = ""
|
||||
elif self.jumphost[key] == '' and key == "protocol":
|
||||
try:
|
||||
self.jumphost[key] = config.profiles["default"][key]
|
||||
except:
|
||||
except KeyError:
|
||||
self.jumphost[key] = "ssh"
|
||||
if isinstance(self.jumphost["password"],list):
|
||||
jumphost_password = []
|
||||
@@ -3053,7 +3063,7 @@ class node:
|
||||
try:
|
||||
decrypted = decryptor.decrypt(ast.literal_eval(passwd)).decode("utf-8")
|
||||
dpass.append(decrypted)
|
||||
except:
|
||||
except Exception:
|
||||
raise ValueError("Missing or corrupted key")
|
||||
return dpass
|
||||
|
||||
@@ -4579,6 +4589,11 @@ def test(self, commands, expected, vars = None,*, prompt = None, parallel = 10,
|
||||
</ul>
|
||||
</div>
|
||||
<ul id="index">
|
||||
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
|
||||
<ul>
|
||||
<li><code><a title="connpy.tests" href="tests/index.html">connpy.tests</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><h3><a href="#header-classes">Classes</a></h3>
|
||||
<ul>
|
||||
<li>
|
||||
@@ -4631,7 +4646,7 @@ def test(self, commands, expected, vars = None,*, prompt = None, parallel = 10,
|
||||
</nav>
|
||||
</main>
|
||||
<footer id="footer">
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.5</a>.</p>
|
||||
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.11.6</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user