diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d01c200 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +**/__pycache__ +build/ +*.egg-info/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4a73b45 --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +all: + pyproject-build + +clean: + rm -rf skitter.egg-info/ + rm -rf dist/ diff --git a/project.toml b/project.toml deleted file mode 100644 index d2d9a69..0000000 --- a/project.toml +++ /dev/null @@ -1,15 +0,0 @@ -[project] -readme = "README.md" -dependencies = [ - "PyQt5>0.0", - "gnuradio>0.0", - "sys>0.0", - "signal>0.0", - "argparse>0.0", - "threading>0.0", - "time" -] - -[project.urls] -Repository = "https://git.therats.win/jazz/skitter" - diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..fbe41e0 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,14 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "skitter" +version = "0.0.0" +readme = "README.md" + +[project.urls] +Repository = "https://git.therats.win/jazz/skitter" + +[project.scripts] +skitter = "skitter.__main__:main" diff --git a/skitter/__init__.py b/skitter/__init__.py new file mode 100644 index 0000000..e5a0d9b --- /dev/null +++ b/skitter/__init__.py @@ -0,0 +1 @@ +#!/usr/bin/env python3 diff --git a/skitter/__main__.py b/skitter/__main__.py new file mode 100644 index 0000000..8800e12 --- /dev/null +++ b/skitter/__main__.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 +""" +yap yap yap +""" +import getopt +import sys + +from skitter.usage import print_help + +def main(): + '''main''' + try: + opts, args = getopt.getopt(sys.argv[1:], + "hb:o:s:r:", + ["help", "band=", "out-directory=", "squelch=", "rate="]) + except getopt.GetoptError: + print_help() + sys.exit(2) + + for o, a in opts: + if o in ('-h', '--help'): + print_help() + sys.exit() + + if o in ('-b', '--band'): + print(f"band {a}") # debug + + if o in ('-o', '--out-directory'): + print(f"dir {a}") # debug + + if o in ('-s', '--squelch'): + print(f"squelch {a}") # debug + + if o in ('-r', '--rate'): + print(f"rate {a}") # debug + +if __name__ == '__main__': + main() diff --git a/skitter/usage.py b/skitter/usage.py new file mode 100644 index 0000000..bda787e --- /dev/null +++ b/skitter/usage.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python3 +"help page" + +from os import getenv + +def print_help(): + """print help""" + NAME = "skitter.py" + VERSION = "0.0.0" + + BANNER = '''\x1b[34m + ▗▖ █ ▄ + ▐▌ ▀ ▐▌ ▐▌ █ +▗▟██▖▐▌▟▛ ██ ▐███ ▐███ ▟█▙ █▟█▌ █ +▐▙▄▖▘▐▙█ █ ▐▌ ▐▌ ▐▙▄▟▌ █▘ █ + ▀▀█▖▐▛█▖ █ ▐▌ ▐▌ ▐▛▀▀▘ █ ▀ +▐▄▄▟▌▐▌▝▙ ▗▄█▄▖ ▐▙▄ ▐▙▄ ▝█▄▄▌ █ ▄ + ▀▀▀ ▝▘ ▀▘▝▀▀▀▘ ▀▀ ▀▀ ▝▀▀ ▀ ▀ +\x1b[0m''' + USAGE = f''' + SYNOPSIS + {NAME} [--band=|-b FREQ] [--out-directory=|-o DIR] [--squelch=|-s LEVEL] [--rate=|-r SPEED] + {NAME} [--help|-h] + + --band + -b + Desired frequencies (list) to scan. + Skitter will sweep through these frequencies at a set rate. + + --out-directory + -o + Output directory. Default: ./ + Skitter will save its recordings in a single directory. + You might want to create a new directory for recordings. + + --squelch + -s + Level at which to start listening, in decibels (dB). + Anything below this level will be ignored. + + --rate + -r + Delay (in milliseconds) between changing channels. + Increase if your receiver cannot switch frequencies + quickly enough. + Default: UNSET + + + --help + -h + Print this message and exit. + + Examples + {NAME} -r 300 + Sweep through default range and change channels every 300 milliseconds. + + {NAME} -o ~/Music/ + Run with all default settings and send files to {getenv("HOME")}/Music +''' + print(BANNER) + print(f"skitter v\x1b[33m{VERSION}\x1b[0m") + print(USAGE) diff --git a/src/help.py b/src/help.py deleted file mode 100644 index 8c301af..0000000 --- a/src/help.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python3 -VERSION = "0.0.0" -BANNER = '''\x1b[34m - ▗▖ █ - ▐▌ ▀ ▐▌ ▐▌ -▗▟██▖▐▌▟▛ ██ ▐███ ▐███ ▟█▙ █▟█▌ -▐▙▄▖▘▐▙█ █ ▐▌ ▐▌ ▐▙▄▟▌ █▘ - ▀▀█▖▐▛█▖ █ ▐▌ ▐▌ ▐▛▀▀▘ █ -▐▄▄▟▌▐▌▝▙ ▗▄█▄▖ ▐▙▄ ▐▙▄ ▝█▄▄▌ █ - ▀▀▀ ▝▘ ▀▘▝▀▀▀▘ ▀▀ ▀▀ ▝▀▀ ▀ -\x1b[0m''' - -USAGE = ''' - ./skitter.py [--band|-b FREQ] [--squelch|-s LEVEL] [--rate|-r SPEED] [--output|-o DIR] - - --band - -b - Desired frequencies (list) to scan. - Skitter will sweep through these frequencies at a set rate. - - --squelch - -s - Level at which to start listening, in decibels (dB). - Anything below this level will be ignored. - - --rate - -s - Rate at which to switch channels. Default: UNSET - Change this is your device is not able to change channels - quickly enough. - - --output - -o - Output directory. Default: ./ - Skitter will save its recordings in a single directory. - You might want to create a new directory for recordings. -''' - -def print_help(): - print(BANNER) - print(f"skitter v\x1b[33m{VERSION}\x1b[0m") - print(USAGE) - -