gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-taler-build-scripts] 02/02: remove ifelse branches


From: gnunet
Subject: [GNUnet-SVN] [taler-taler-build-scripts] 02/02: remove ifelse branches
Date: Fri, 04 Oct 2019 16:02:55 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository taler-build-scripts.

commit b2ad1a45ece15be2be0c2882f095d43b50ce7a88
Author: ng0 <address@hidden>
AuthorDate: Fri Oct 4 14:02:27 2019 +0000

    remove ifelse branches
---
 configure.py | 59 +++++++++++++++++++++++++++++------------------------------
 1 file changed, 29 insertions(+), 30 deletions(-)

diff --git a/configure.py b/configure.py
index 35edac0..68b9176 100644
--- a/configure.py
+++ b/configure.py
@@ -36,42 +36,41 @@ def _read_prefix():
     logging.basicConfig(level=logging.DEBUG)
     logger = logging.getLogger(__name__)
 
+
+    if 'DEBUG' in os.environ:
+        logger.debug('PREFIX from argv')
+    parser = argparse.ArgumentParser()
+    parser.add_argument("-p",
+                        "--prefix",
+                        type=str,
+                        default="/usr/local",
+                        # required=True,
+                        help='Directory prefix for installation')
+    parser.add_argument("-y",
+                        "--yarn",
+                        type=str,
+                        required=True,
+                        help='name of yarn executable')
+    if 'DEBUG' in os.environ:
+        logger.debug('parser.parse_args step')
+    args = parser.parse_args()
+    if 'DEBUG' in os.environ:
+        logger.debug('%s', args)
     if 'PREFIX' in os.environ:
         if 'DEBUG' in os.environ:
             logger.debug('PREFIX from environment')
-        myprefix = os.environ.get('PREFIX')
-        if myprefix is not None and os.path.isdir(myprefix) is True:
+        p_myprefix = os.environ.get('PREFIX')
+        if p_myprefix is not None and os.path.isdir(p_myprefix) is True:
             if 'DEBUG' in os.environ:
-                logger.debug('PREFIX from environment: %s', myprefix)
-            return myprefix
-
+                logger.debug('PREFIX from environment: %s', p_myprefix)
+            myprefix = p_myprefix
     else:
-        if 'DEBUG' in os.environ:
-            logger.debug('PREFIX from argv')
-        parser = argparse.ArgumentParser()
-        parser.add_argument("-p",
-                            "--prefix",
-                            type=str,
-                            default="/usr/local",
-                            # required=True,
-                            help='Directory prefix for installation')
-        parser.add_argument("-y",
-                            "--yarn",
-                            type=str,
-                            required=True,
-                            help='name of yarn executable')
-        if 'DEBUG' in os.environ:
-            logger.debug('parser.parse_args step')
-        args = parser.parse_args()
-        if 'DEBUG' in os.environ:
-            logger.debug('%s', args)
         myprefix = args.prefix
-        yarnexe = args.yarn
-        if 'DEBUG' in os.environ:
-            logger.debug('%s', repr(myprefix))
-        # if args.prefix is not None and os.path.isdir(myprefix) is True:
-        if args.prefix and os.path.isdir(myprefix) is True:
-            return [myprefix, yarnexe];
+    yarnexe = args.yarn
+    if 'DEBUG' in os.environ:
+        logger.debug('%s', repr(myprefix))
+    if args.prefix and os.path.isdir(myprefix) is True:
+        return [myprefix, yarnexe];
 
 def main():
     # mylist = str(_read_prefix())

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]