[yt-svn] commit/yt: 3 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon May 29 16:57:50 PDT 2017


3 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/a87913080af7/
Changeset:   a87913080af7
User:        xarthisius
Date:        2017-05-29 15:15:31+00:00
Summary:     Error out early if user doesn't have an API key
Affected #:  1 file

diff -r 795a34ed60c0658469eefa15b8845e2ec5f28ead -r a87913080af765a1b5dbaf00483ee214fa8063c8 yt/utilities/command_line.py
--- a/yt/utilities/command_line.py
+++ b/yt/utilities/command_line.py
@@ -139,7 +139,13 @@
         print("Please install them using your python package manager, e.g.:")
         print("   pip install girder_client --user")
         exit()
-
+    if not ytcfg.get("yt", "hub_api_key"):
+        print("Before you can access the yt Hub you need an API key")
+        print("In order to obtain one, either register by typing:")
+        print("  yt hub register")
+        print("or follow the instruction on:")
+        print("  http://yt-project.org/docs/dev/sharing_data.html#obtaining-an-api-key")
+        sys.exit()
     hub_url = urlparse(ytcfg.get("yt", "hub_url"))
     gc = girder_client.GirderClient(apiUrl=hub_url.geturl())
     gc.authenticate(apiKey=ytcfg.get("yt", "hub_api_key"))


https://bitbucket.org/yt_analysis/yt/commits/a904674e20dd/
Changeset:   a904674e20dd
User:        xarthisius
Date:        2017-05-29 19:35:24+00:00
Summary:     Use sys.exit() consistently
Affected #:  1 file

diff -r a87913080af765a1b5dbaf00483ee214fa8063c8 -r a904674e20dd1ee27ab6068225dafe4b76efb615 yt/utilities/command_line.py
--- a/yt/utilities/command_line.py
+++ b/yt/utilities/command_line.py
@@ -138,7 +138,7 @@
         print("this command requires girder_client to be installed")
         print("Please install them using your python package manager, e.g.:")
         print("   pip install girder_client --user")
-        exit()
+        sys.exit()
     if not ytcfg.get("yt", "hub_api_key"):
         print("Before you can access the yt Hub you need an API key")
         print("In order to obtain one, either register by typing:")
@@ -622,12 +622,12 @@
             print("yt {} requires requests to be installed".format(self.name))
             print("Please install them using your python package manager, e.g.:")
             print("   pip install requests --user")
-            exit()
+            sys.exit()
         if ytcfg.get("yt", "hub_api_key") != "":
             print("You seem to already have an API key for the hub in")
             print("{} . Delete this if you want to force a".format(CURRENT_CONFIG_FILE))
             print("new user registration.")
-            exit()
+            sys.exit()
         print("Awesome!  Let's start by registering a new user for you.")
         print("Here's the URL, for reference: http://hub.yt/ ")
         print()


https://bitbucket.org/yt_analysis/yt/commits/4b22085ba0b7/
Changeset:   4b22085ba0b7
User:        ngoldbaum
Date:        2017-05-29 23:57:24+00:00
Summary:     Merge pull request #1429 from Xarthisius/hub_error

Error out early if user doesn't have an API key
Affected #:  1 file

diff -r 795a34ed60c0658469eefa15b8845e2ec5f28ead -r 4b22085ba0b75e00f4176024e555d459c8f0451d yt/utilities/command_line.py
--- a/yt/utilities/command_line.py
+++ b/yt/utilities/command_line.py
@@ -138,8 +138,14 @@
         print("this command requires girder_client to be installed")
         print("Please install them using your python package manager, e.g.:")
         print("   pip install girder_client --user")
-        exit()
-
+        sys.exit()
+    if not ytcfg.get("yt", "hub_api_key"):
+        print("Before you can access the yt Hub you need an API key")
+        print("In order to obtain one, either register by typing:")
+        print("  yt hub register")
+        print("or follow the instruction on:")
+        print("  http://yt-project.org/docs/dev/sharing_data.html#obtaining-an-api-key")
+        sys.exit()
     hub_url = urlparse(ytcfg.get("yt", "hub_url"))
     gc = girder_client.GirderClient(apiUrl=hub_url.geturl())
     gc.authenticate(apiKey=ytcfg.get("yt", "hub_api_key"))
@@ -616,12 +622,12 @@
             print("yt {} requires requests to be installed".format(self.name))
             print("Please install them using your python package manager, e.g.:")
             print("   pip install requests --user")
-            exit()
+            sys.exit()
         if ytcfg.get("yt", "hub_api_key") != "":
             print("You seem to already have an API key for the hub in")
             print("{} . Delete this if you want to force a".format(CURRENT_CONFIG_FILE))
             print("new user registration.")
-            exit()
+            sys.exit()
         print("Awesome!  Let's start by registering a new user for you.")
         print("Here's the URL, for reference: http://hub.yt/ ")
         print()

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list