diff --git a/bin/python-tool b/bin/python-tool index 8fe794e..8e1d2ef 100644 --- a/bin/python-tool +++ b/bin/python-tool @@ -18,7 +18,7 @@ if __name__ == '__main__': # Gather Argument options EXAMPLE_TEXT='Example:\n\tpython-tool -h' parser = argparse.ArgumentParser(epilog=EXAMPLE_TEXT,formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('-c', '--config', action='store', help='Specify a config file (~/.config/python-tool.yml)',default='~/.config/python-tool.yml') + ##config_parser.add_argument('-c', '--config', action='store', help='Specify a config file (~/.config/python-tool.yml)',default='~/.config/python-tool.yml') parser.add_argument('-H', '--hosts', action='append', default=None, help='Collects arguments in an array.') parser.add_argument('-d', '--dry-run', action='store_true', help='Store the existence of a variable.') parser.add_argument('-l', '--log', action='store', help='Specify a file to log to.') diff --git a/new_python_tool.sh b/new_python_tool.sh index 44cd5f2..20e4643 100755 --- a/new_python_tool.sh +++ b/new_python_tool.sh @@ -94,7 +94,8 @@ new_python_tool() { done if [ "$PYTHON_MODULE" == 'y' ]; then mkdir ./"$NAME"/"$NAME" - touch ./"$NAME"/"$NAME"/__init__.py +# touch ./"$NAME"/"$NAME"/__init__.py + echo "from $NAME.$NAME import *" > ./"$NAME"/"$NAME"/__init__.py touch ./"$NAME"/"$NAME"/"$NAME".py PYTHON_TOOL_SETUP_INSTRUCTIONS+="Put your main classes and functionality in $NAME/$NAME.py and import/use that functionality in bin/$NAME" else @@ -141,12 +142,15 @@ new_python_tool() { # Configure package to install a default configuration file? while [[ "$INSTALL_CONFIG" != 'y' && "$INSTALL_CONFIG" != "n" ]]; do - echo "Configure package to install a config file? (y/n)" + echo "Configure package to use and install a config file? (y/n)" read INSTALL_CONFIG done if [ "$INSTALL_CONFIG" == 'y' ]; then sed_i "s#INSTALL=\"\(.*\)\"#INSTALL=\"\1config \"#g" ./"$NAME"/setup.sh + sed_i "s/.*##config_\(parser.*\)/\1/g" ./"$NAME"/bin/"$NAME" + ##config_parser else + sed_i "s/.*##config_\(parser.*\)//g" ./"$NAME"/bin/"$NAME" rm ./"$NAME"/config.yml fi