From 50d498bc97c8b3d34dec67615716019ba08bfa5d Mon Sep 17 00:00:00 2001 From: brent s Date: Fri, 11 Nov 2016 21:55:53 -0500 Subject: [PATCH] adding python-menu3 --- .gitmodules | 3 +++ _bin/new.package.py | 51 ++++++++++++++++++++++++++++++++++++++++++++- python-menu3 | 1 + 3 files changed, 54 insertions(+), 1 deletion(-) mode change 100644 => 100755 _bin/new.package.py create mode 160000 python-menu3 diff --git a/.gitmodules b/.gitmodules index c39ddcf..1c33440 100644 --- a/.gitmodules +++ b/.gitmodules @@ -145,3 +145,6 @@ [submodule "python-zconfig"] path = python-zconfig url = aur@aur.archlinux.org:python-zconfig +[submodule "python-menu3"] + path = python-menu3 + url = aur@aur.archlinux.org:python-menu3 diff --git a/_bin/new.package.py b/_bin/new.package.py old mode 100644 new mode 100755 index 89aa751..6a2de7e --- a/_bin/new.package.py +++ b/_bin/new.package.py @@ -1,10 +1,59 @@ #!/usr/bin/env python3 +import curses +import os +import subprocess +import pygit2 + ## SETTINGS ## gpgkey = '748231EBCBD808A14F5E85D28C004C2F93481F6B' # https://wiki.archlinux.org/index.php/PKGBUILD#validpgpkeys maintname = 'brent s. ' # your name and email address, feel free to obfuscate though pkgbuild_dir = '/opt/dev/arch' # what dir do the pkgbuilds/AUR checkouts live? aur_pkgs_dir = pkgbuild_dir # should be the dir where the aur_pkgs repo checkout lives. it's recommended you keep this the same as pkgbuild_dir +## BUILD THE GUI ## +def gui_init(): + # props to https://gist.github.com/abishur/2482046 + screen = curses.initscr() + curses.noecho() + curses.cbreak() + curses.start_color() + screen.keypad(True) + curses.init_pair(1, curses.COLOR_BLACK, curses.COLOR_WHITE) # might change this. black text, white BG + h = curses.color_pair(1) + n = curses.A_NORMAL + MENU = "menu" + COMMAND = "command" + EXITMENU = "exitmenu" + + menu_data = {'title': "AUR_Pkgs Packaging Menu", 'type': MENU, 'subtitle': "How might I assist you today?", + 'options':[ + { 'title': "Add a new package to the AUR...", 'type': MENU, 'subtitle': 'Use this submenu to add new packages.', + 'options': [ + { ' + }, + { 'title': "Sign a package's sources", 'type': COMMAND, 'command': 'sign_pkg' }, + { 'title': "Update/initialize submodules from the AUR", 'type': COMMAND, 'command': 'fetch_aur' } + ] + } + +gui_init() + + + +# Get the package type +def get_pkgtype(): + pkgtype = True + while pkgtype: + print(""" + What type of package is this? + 1 Release/Versioned + 2 VCS (Git, SVN, Mercurial, etc.) + 3 Quit + """) + pkgtype = input() + #if pkgtype == + +# Get the package name def get_pkgname(): - + pkgname = input('What is the name of this package?') diff --git a/python-menu3 b/python-menu3 new file mode 160000 index 0000000..f2dd884 --- /dev/null +++ b/python-menu3 @@ -0,0 +1 @@ +Subproject commit f2dd884c1f3b4cae97d1566163ca4c8ba21eb437