docs: bump version to 5.0b2 and regenerate documentation

This commit is contained in:
2026-04-03 17:14:16 -03:00
parent cf95befb43
commit 5d8c372f23
12 changed files with 7976 additions and 37 deletions
+51 -36
View File
@@ -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 == &#39;__name__&#39; and
isinstance(node.test.comparators[0], ast.Str) and
node.test.comparators[0].s == &#39;__main__&#39;):
((hasattr(ast, &#39;Str&#39;) and isinstance(node.test.comparators[0], getattr(ast, &#39;Str&#39;)) and node.test.comparators[0].s == &#39;__main__&#39;) or
(hasattr(ast, &#39;Constant&#39;) and isinstance(node.test.comparators[0], getattr(ast, &#39;Constant&#39;)) and node.test.comparators[0].value == &#39;__main__&#39;))):
return &#34;Only __name__ == __main__ If is allowed&#34;
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 == &#39;__name__&#39; and
isinstance(node.test.comparators[0], ast.Str) and
node.test.comparators[0].s == &#39;__main__&#39;):
((hasattr(ast, &#39;Str&#39;) and isinstance(node.test.comparators[0], getattr(ast, &#39;Str&#39;)) and node.test.comparators[0].s == &#39;__main__&#39;) or
(hasattr(ast, &#39;Constant&#39;) and isinstance(node.test.comparators[0], getattr(ast, &#39;Constant&#39;)) and node.test.comparators[0].value == &#39;__main__&#39;))):
return &#34;Only __name__ == __main__ If is allowed&#34;
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(&#39;\n&#39;) 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&#34;[bold red]Error fetching summary: {e}[/bold red]&#34;)
printer.warning(f&#34;Failed to fetch final summary from LLM: {e}&#34;)
except KeyboardInterrupt:
if status: status.update(&#34;[bold red]Interrupted! Closing pending tasks...&#34;)
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, &#34;r&#34;) as f: hist = json.load(f)
except: hist = []
except (IOError, json.JSONDecodeError): hist = []
hist.append({&#34;timestamp&#34;: datetime.datetime.now().isoformat(), &#34;roles&#34;: {&#34;strategic_engine&#34;: self.architect_model, &#34;execution_engine&#34;: self.engineer_model}, &#34;session&#34;: messages})
with open(log_path, &#34;w&#34;) 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&#34;[bold red]Error fetching summary: {e}[/bold red]&#34;)
printer.warning(f&#34;Failed to fetch final summary from LLM: {e}&#34;)
except KeyboardInterrupt:
if status: status.update(&#34;[bold red]Interrupted! Closing pending tasks...&#34;)
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, &#34;r&#34;) as f: hist = json.load(f)
except: hist = []
except (IOError, json.JSONDecodeError): hist = []
hist.append({&#34;timestamp&#34;: datetime.datetime.now().isoformat(), &#34;roles&#34;: {&#34;strategic_engine&#34;: self.architect_model, &#34;execution_engine&#34;: self.engineer_model}, &#34;session&#34;: messages})
with open(log_path, &#34;w&#34;) 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(&#39;\n&#39;) 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, &#34;r&#34;) as f:
configdir = f.read().strip()
except:
except (FileNotFoundError, IOError):
with open(pathfile, &#34;w&#34;) as f:
f.write(str(defaultdir))
configdir = defaultdir
@@ -2306,7 +2315,8 @@ class configfile:
with open(conf, &#34;w&#34;) as f:
json.dump(newconfig, f, indent = 4)
f.close()
except:
except (IOError, OSError) as e:
printer.error(f&#34;Failed to save config: {e}&#34;)
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] = &#34;&#34;
elif value == &#39;&#39; and key == &#34;protocol&#34;:
try:
newfolder[node_name][key] = self.profiles[&#34;default&#34;][key]
except:
except KeyError:
newfolder[node_name][key] = &#34;ssh&#34;
newfolder = {&#34;{}{}&#34;.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] = &#34;&#34;
elif value == &#39;&#39; and key == &#34;protocol&#34;:
try:
newnode[key] = self.profiles[&#34;default&#34;][key]
except:
except KeyError:
newnode[key] = &#34;ssh&#34;
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] = &#34;&#34;
elif value == &#39;&#39; and key == &#34;protocol&#34;:
try:
nodes[node][key] = self.profiles[&#34;default&#34;][key]
except:
except KeyError:
nodes[node][key] = &#34;ssh&#34;
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] = &#34;&#34;
elif value == &#39;&#39; and key == &#34;protocol&#34;:
try:
newfolder[node_name][key] = self.profiles[&#34;default&#34;][key]
except:
except KeyError:
newfolder[node_name][key] = &#34;ssh&#34;
newfolder = {&#34;{}{}&#34;.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] = &#34;&#34;
elif value == &#39;&#39; and key == &#34;protocol&#34;:
try:
newnode[key] = self.profiles[&#34;default&#34;][key]
except:
except KeyError:
newnode[key] = &#34;ssh&#34;
return newnode</code></pre>
</details>
@@ -2979,12 +2989,12 @@ class node:
if profile and config != &#39;&#39;:
try:
setattr(self,key,config.profiles[profile.group(1)][key])
except:
except KeyError:
setattr(self,key,&#34;&#34;)
elif attr[key] == &#39;&#39; and key == &#34;protocol&#34;:
try:
setattr(self,key,config.profiles[&#34;default&#34;][key])
except:
except (KeyError, AttributeError):
setattr(self,key,&#34;ssh&#34;)
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] = &#34;&#34;
elif self.jumphost[key] == &#39;&#39; and key == &#34;protocol&#34;:
try:
self.jumphost[key] = config.profiles[&#34;default&#34;][key]
except:
except KeyError:
self.jumphost[key] = &#34;ssh&#34;
if isinstance(self.jumphost[&#34;password&#34;],list):
jumphost_password = []
@@ -3053,7 +3063,7 @@ class node:
try:
decrypted = decryptor.decrypt(ast.literal_eval(passwd)).decode(&#34;utf-8&#34;)
dpass.append(decrypted)
except:
except Exception:
raise ValueError(&#34;Missing or corrupted key&#34;)
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>