From 51c3427c5eba2f7a5b9bee1147e27a27615d432e Mon Sep 17 00:00:00 2001 From: Innovation Date: Sun, 15 Dec 2024 11:52:31 -0600 Subject: [PATCH] Begin tracking ufpsutil --- requirements.txt | 0 tests/__init__.py | 0 tests/test_libufps.py | 1 + tests/testfiles/0644 | 1 + tests/testfiles/linktests/link | 1 + tests/testfiles/linktests/linkdir/linkfile | 0 tests/testfiles/linktests/linkfile | 0 ufpsutil.py | 12 ++++++++++++ 8 files changed, 15 insertions(+) create mode 100644 requirements.txt create mode 100644 tests/__init__.py create mode 100644 tests/test_libufps.py create mode 100644 tests/testfiles/0644 create mode 120000 tests/testfiles/linktests/link create mode 100644 tests/testfiles/linktests/linkdir/linkfile create mode 100644 tests/testfiles/linktests/linkfile create mode 100644 ufpsutil.py diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_libufps.py b/tests/test_libufps.py new file mode 100644 index 0000000..c627fd7 --- /dev/null +++ b/tests/test_libufps.py @@ -0,0 +1 @@ +import libufps diff --git a/tests/testfiles/0644 b/tests/testfiles/0644 new file mode 100644 index 0000000..332bab3 --- /dev/null +++ b/tests/testfiles/0644 @@ -0,0 +1 @@ +File permissions should equal 0644 diff --git a/tests/testfiles/linktests/link b/tests/testfiles/linktests/link new file mode 120000 index 0000000..13c5708 --- /dev/null +++ b/tests/testfiles/linktests/link @@ -0,0 +1 @@ +linkdir/ \ No newline at end of file diff --git a/tests/testfiles/linktests/linkdir/linkfile b/tests/testfiles/linktests/linkdir/linkfile new file mode 100644 index 0000000..e69de29 diff --git a/tests/testfiles/linktests/linkfile b/tests/testfiles/linktests/linkfile new file mode 100644 index 0000000..e69de29 diff --git a/ufpsutil.py b/ufpsutil.py new file mode 100644 index 0000000..8081233 --- /dev/null +++ b/ufpsutil.py @@ -0,0 +1,12 @@ +from libufps import ufps +from inspect import getmembers, isfunction +print(getmembers(ufps, isfunction)) + +basedir = "." + +ufps = ufps.ufps(basedir) + +print("Regular dir: " + str(ufps.getFilePermissions("tests/testfiles/")) + " | " + str(ufps.getFileOwner("tests/testfiles/"))) +print("Regular file: " + str(ufps.getFilePermissions("tests/testfiles/0644")) + " | " + str(ufps.getFileOwner("tests/testfiles/0644"))) +print("Linked dir: " + str(ufps.getFilePermissions("tests/testfiles/linktests/link")) + " | " + str(ufps.getFileOwner("tests/testfiles/linktests/link"))) +print("Linked file: " + str(ufps.getFilePermissions("tests/testfiles/linktests/linkfile")) + " | " + str(ufps.getFileOwner("tests/testfiles/linktests/linkfile")))