I think this is packaged correctly

This commit is contained in:
Benson Chu 2025-04-26 19:16:13 -05:00
parent 0b8d47824a
commit dfdd1bbb34
9 changed files with 40 additions and 2 deletions

0
newfol/__init__.py Normal file
View file

View file

@ -1,7 +1,6 @@
#! /usr/bin/python3
import sys
sys.path.insert(0, sys.path[0] + "/lib")
import gettext
import locale
@ -12,7 +11,7 @@ import newfol.main
from gettext import gettext as _
from newfol.exception import LocaleError
if __name__ == '__main__':
def main():
try:
locale.setlocale(locale.LC_ALL, '')
gettext.bindtextdomain('newfol')
@ -28,3 +27,6 @@ if __name__ == '__main__':
except newfol.exception.FilemanipError as e:
sys.stderr.write(_("E: %s\n") % e)
sys.exit(2)
if __name__ == "__main__":
main()

14
setup.py Normal file
View file

@ -0,0 +1,14 @@
import setuptools
setuptools.setup(
name = "NewFol",
version = "0.0.1",
author = "Brian",
description = "Database program for Peter Hodgson",
scripts = ["newfol/newfol.py"],
entry_points = {
'console_scripts': [
'newfol = newfol.__main__:main'
]
}
)

22
shell.nix Normal file
View file

@ -0,0 +1,22 @@
with import <nixpkgs> {};
let
pythonPackages = pkgs.python3Packages;
newfol =
pythonPackages.buildPythonPackage rec {
name = "newfol";
src = ./.;
propagatedBuildInputs = [
pythonPackages.urwid
];
postInstall = ''
mv -v $out/bin/newfol.py $out/bin/newfol
'';
};
in
pkgs.mkShell {
buildInputs = with pythonPackages; [
# newfol
];
packages = [ newfol ];
}