olantemp 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- olantemp-0.1.0/PKG-INFO +10 -0
- olantemp-0.1.0/README.md +1 -0
- olantemp-0.1.0/olantemp/__init__.py +3 -0
- olantemp-0.1.0/olantemp/cli.py +34 -0
- olantemp-0.1.0/olantemp.egg-info/PKG-INFO +10 -0
- olantemp-0.1.0/olantemp.egg-info/SOURCES.txt +9 -0
- olantemp-0.1.0/olantemp.egg-info/dependency_links.txt +1 -0
- olantemp-0.1.0/olantemp.egg-info/entry_points.txt +2 -0
- olantemp-0.1.0/olantemp.egg-info/top_level.txt +1 -0
- olantemp-0.1.0/pyproject.toml +20 -0
- olantemp-0.1.0/setup.cfg +4 -0
olantemp-0.1.0/PKG-INFO
ADDED
olantemp-0.1.0/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
none
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import os, argparse, subprocess
|
|
2
|
+
from glob import glob
|
|
3
|
+
def main():
|
|
4
|
+
tempfolder = os.getenv("TEMPCLIFOLDER")
|
|
5
|
+
editor = os.getenv("EDITOR")
|
|
6
|
+
|
|
7
|
+
parser = argparse.ArgumentParser()
|
|
8
|
+
cmds = parser.add_subparsers(dest="cmd")
|
|
9
|
+
|
|
10
|
+
addParser = cmds.add_parser("add", help="add a file")
|
|
11
|
+
addParser.add_argument("file")
|
|
12
|
+
|
|
13
|
+
rmParser = cmds.add_parser("rm", help="remove a file")
|
|
14
|
+
rmParser.add_argument("file")
|
|
15
|
+
|
|
16
|
+
editParser = cmds.add_parser("edit", help="edit a file")
|
|
17
|
+
editParser.add_argument("file")
|
|
18
|
+
|
|
19
|
+
listParser = cmds.add_parser("list", help="list the temp folder")
|
|
20
|
+
|
|
21
|
+
clearParser = cmds.add_parser("clear", help="clear the temp folder")
|
|
22
|
+
|
|
23
|
+
args = parser.parse_args()
|
|
24
|
+
if args.cmd == "add":
|
|
25
|
+
subprocess.run(["touch", f"{tempfolder}/{args.file}"])
|
|
26
|
+
elif args.cmd == "rm":
|
|
27
|
+
subprocess.run(["rm", f"{tempfolder}/{args.file}"])
|
|
28
|
+
elif args.cmd == "edit":
|
|
29
|
+
subprocess.run([editor, f"{tempfolder}/{args.file}"])
|
|
30
|
+
elif args.cmd == "list":
|
|
31
|
+
subprocess.run(["ls", tempfolder])
|
|
32
|
+
elif args.cmd == "clear":
|
|
33
|
+
files = glob(f"{tempfolder}/*")
|
|
34
|
+
subprocess.run(["rm", "-rf", *files])
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
olantemp
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "olantemp"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A tiny temporary file manager"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Olan"}
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
[project.scripts]
|
|
17
|
+
temp = "olantemp.cli:main"
|
|
18
|
+
|
|
19
|
+
[tool.setuptools]
|
|
20
|
+
packages = ["olantemp"]
|
olantemp-0.1.0/setup.cfg
ADDED