From 9acf3a3296ea7ef56a8a1b28a21c25ab0e7163c3 Mon Sep 17 00:00:00 2001 From: Martinez Date: Mon, 8 Jun 2015 20:49:20 +0200 Subject: [PATCH 1/3] fix interpreter hashbang, fix missing returncode in over.core.cmd --- __init__.py | 2 +- aux.py | 2 +- core/__init__.py | 2 +- core/app.py | 2 +- core/aux.py | 2 +- core/cmd.py | 3 ++- core/file.py | 2 +- core/misc.py | 2 +- core/python_types.py | 2 +- core/text.py | 2 +- m/__init__.py | 2 +- m/python_m.py | 2 +- serial/com.py | 2 +- version.py | 2 +- 14 files changed, 15 insertions(+), 14 deletions(-) diff --git a/__init__.py b/__init__.py index f414966..2a2409b 100644 --- a/__init__.py +++ b/__init__.py @@ -1,4 +1,4 @@ -#! /bin/env python3 +#! /usr/bin/env python3 # encoding: utf-8 import time diff --git a/aux.py b/aux.py index 3edd3e8..d2aa393 100644 --- a/aux.py +++ b/aux.py @@ -1,4 +1,4 @@ -#! /bin/env python3 +#! /usr/bin/env python3 # encoding: utf-8 import sys diff --git a/core/__init__.py b/core/__init__.py index 13db0b4..59487ef 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -1,4 +1,4 @@ -#! /bin/env python3 +#! /usr/bin/env python3 # encoding: utf-8 from . import app diff --git a/core/app.py b/core/app.py index bd9f6b2..c26eae7 100644 --- a/core/app.py +++ b/core/app.py @@ -1,4 +1,4 @@ -#! /bin/env python3 +#! /usr/bin/env python3 # encoding: utf-8 import os diff --git a/core/aux.py b/core/aux.py index 53d020a..5059288 100644 --- a/core/aux.py +++ b/core/aux.py @@ -1,4 +1,4 @@ -#! /bin/env python3 +#! /usr/bin/env python3 # encoding: utf-8 import sys diff --git a/core/cmd.py b/core/cmd.py index 4cc2963..6045017 100644 --- a/core/cmd.py +++ b/core/cmd.py @@ -1,4 +1,4 @@ -#! /bin/env python3 +#! /usr/bin/env python3 # encoding: utf-8 import queue @@ -66,6 +66,7 @@ class Command: self.__dict__['thread'] = None self.__dict__['fifo'] = None self.__dict__['terminated'] = False + self.__dict__['returncode'] = None def dump(self, sequence=None, pretty=False): out = [] diff --git a/core/file.py b/core/file.py index 9315913..f793f91 100644 --- a/core/file.py +++ b/core/file.py @@ -1,4 +1,4 @@ -#! /bin/env python3 +#! /usr/bin/env python3 # encoding: utf-8 import os diff --git a/core/misc.py b/core/misc.py index be2cefe..80edd83 100644 --- a/core/misc.py +++ b/core/misc.py @@ -1,4 +1,4 @@ -#! /bin/env python3 +#! /usr/bin/env python3 # encoding: utf-8 import copy diff --git a/core/python_types.py b/core/python_types.py index 801e0f2..3dbd001 100644 --- a/core/python_types.py +++ b/core/python_types.py @@ -1,4 +1,4 @@ -#! /bin/env python3 +#! /usr/bin/env python3 # encoding: utf-8 # -------------------------------------------------- diff --git a/core/text.py b/core/text.py index 848e9ee..4ffdbee 100644 --- a/core/text.py +++ b/core/text.py @@ -1,4 +1,4 @@ -#! /bin/env python3 +#! /usr/bin/env python3 # encoding: utf-8 import math diff --git a/m/__init__.py b/m/__init__.py index 8d143d4..569ddfd 100644 --- a/m/__init__.py +++ b/m/__init__.py @@ -1,4 +1,4 @@ -#! /bin/env python3 +#! /usr/bin/env python3 # encoding: utf-8 # # Part of Project Overwatch diff --git a/m/python_m.py b/m/python_m.py index a4310a7..d1fb0a5 100644 --- a/m/python_m.py +++ b/m/python_m.py @@ -1,4 +1,4 @@ -#! /bin/env python3 +#! /usr/bin/env python3 # encoding: utf-8 ''' diff --git a/serial/com.py b/serial/com.py index eedf43d..6b075c4 100644 --- a/serial/com.py +++ b/serial/com.py @@ -1,4 +1,4 @@ -#! /bin/env python3 +#! /usr/bin/env python3 # encoding: utf-8 import time diff --git a/version.py b/version.py index 91b177c..5b83190 100644 --- a/version.py +++ b/version.py @@ -1,4 +1,4 @@ -#! /bin/env python3 +#! /usr/bin/env python3 # encoding: utf-8 _version = (0, '00000000') # OVER_VERSION_IDENTIFIER From 9565fdcee6dfc585d0902ea812723a59e144e6aa Mon Sep 17 00:00:00 2001 From: Martinez Date: Mon, 8 Jun 2015 21:05:53 +0200 Subject: [PATCH 2/3] add over boilerplate deployment script --- .over_inhibit_deployment | 0 deploy-template.sh | 14 ++++++++++++++ template.py | 31 +++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 .over_inhibit_deployment create mode 100755 deploy-template.sh create mode 100644 template.py diff --git a/.over_inhibit_deployment b/.over_inhibit_deployment new file mode 100644 index 0000000..e69de29 diff --git a/deploy-template.sh b/deploy-template.sh new file mode 100755 index 0000000..671c18c --- /dev/null +++ b/deploy-template.sh @@ -0,0 +1,14 @@ +#! /bin/zsh +# encoding: utf-8 + +if [[ -a ".over_inhibit_deployment" ]]; then + echo '!! deployment inhibited by lock file (hint: run this from the target directory, not the over directory)' +elif [[ -n "$1" ]]; then + OVER_DIR="$(readlink -f "$(dirname "$0")")" + ln -s "$OVER_DIR" + cp "$OVER_DIR/template.py" "$1" + chmod +x "$1" + echo "over" >> .gitignore +else + echo '!! Missing argument (program name).' +fi diff --git a/template.py b/template.py new file mode 100644 index 0000000..ff299dc --- /dev/null +++ b/template.py @@ -0,0 +1,31 @@ +#! /usr/bin/env python3 +# encoding: utf-8 + +# library imports +import over + +# local imports +#import version + +# -------------------------------------------------- +# Exceptions + +class ConfigurationError(Exception): + pass + +# -------------------------------------------------- +# Functions + +# -------------------------------------------------- +# Classes + +# -------------------------------------------------- + +if __name__ == '__main__': + main = over.core.app.Main('PROGRAM_NAME', version.str, 'AO-JSL') + main.add_option('option', 'type', 'default', 'Description.', short_name='s') + main.add_help('Description', ['What it does.']) + main.enable_help('h') + main.parse() + + ... From dcfa51cd00349d84fb40f6a1058282a38249b9f7 Mon Sep 17 00:00:00 2001 From: Martinez Date: Mon, 8 Jun 2015 21:09:49 +0200 Subject: [PATCH 3/3] fix wrong call in template.py --- template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template.py b/template.py index ff299dc..bbdb0c5 100644 --- a/template.py +++ b/template.py @@ -22,7 +22,7 @@ class ConfigurationError(Exception): # -------------------------------------------------- if __name__ == '__main__': - main = over.core.app.Main('PROGRAM_NAME', version.str, 'AO-JSL') + main = over.core.app.Main('short-name', 'Human Readable Name', version.str, 'LICENSE', use_cfg_file=False) main.add_option('option', 'type', 'default', 'Description.', short_name='s') main.add_help('Description', ['What it does.']) main.enable_help('h')