MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / find_free_port

Function find_free_port

Scripts/ButSystem.py:16801–16843  ·  view source on GitHub ↗

find_free_port. Route handler or application helper. This docstring was expanded to make future maintenance easier. Args: preferred: Parameter. Returns: Varies.

(preferred=6969)

Source from the content-addressed store, hash-verified

16799 filtered.append({"id": r["id"], "first": first, "last": last, "updated_at": r["updated_at"]})
16800 entries = filtered[:200]
16801
16802 class Obj:
16803 def __init__(self, d):
16804 """__init__.
16805
16806Internal helper function.
16807
16808This docstring was added automatically to improve maintainability.
16809
16810Args:
16811 self: Parameter.
16812 d: Parameter.
16813
16814Returns:
16815 Varies.
16816"""
16817 self.__dict__.update(d)
16818 return render_template("profiler.html", title="Profiler", entries=[Obj(e) for e in entries], q=q)
16819
16820@app.route("/profiler/export", methods=["POST"])
16821@login_required
16822def profiler_export():
16823 """profiler_export.
16824
16825Route handler or application helper.
16826
16827This docstring was expanded to make future maintenance easier.
16828
16829Returns:
16830 Varies.
16831"""
16832 owner = current_user()
16833 # Export all of *your* encrypted profiles into a zip in Downloads
16834 try:
16835 conn = db_connect()
16836 entries = conn.execute("SELECT id, first_enc, last_enc, info_enc, optional_enc, created_at, updated_at FROM profiler_entries WHERE owner=? ORDER BY id ASC", (owner,)).fetchall()
16837 att_rows = conn.execute("SELECT entry_id, filename_enc, mime_enc, stored_path, created_at FROM profiler_attachments WHERE entry_id IN (SELECT id FROM profiler_entries WHERE owner=?) ORDER BY id ASC", (owner,)).fetchall()
16838 conn.close()
16839
16840 # Build export structure
16841 export = []
16842 atts_by_entry = {}
16843 for a in att_rows:
16844 atts_by_entry.setdefault(a["entry_id"], []).append(dict(a))
16845
16846 tmp_dir = os.path.join(BASE_DIR, "_tmp_profiler_export")

Callers 1

mainFunction · 0.70

Calls 1

_tryFunction · 0.70

Tested by

no test coverage detected