[yt-svn] commit/yt: ngoldbaum: Merged in migueldvb/yt (pull request #2046)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Mar 16 18:40:51 PDT 2016


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/1cc2beb515d1/
Changeset:   1cc2beb515d1
Branch:      yt
User:        ngoldbaum
Date:        2016-03-17 01:40:43+00:00
Summary:     Merged in migueldvb/yt (pull request #2046)

Use parentheses in call to print
Affected #:  2 files

diff -r 9f8461c82f40422fce303ee43132a0c8b7afbc65 -r 1cc2beb515d168c04a39df000d33bd4f06f987d4 scripts/iyt
--- a/scripts/iyt
+++ b/scripts/iyt
@@ -1,5 +1,7 @@
 #!python
-import os, re
+from __future__ import print_function
+import os
+import re
 from distutils.version import LooseVersion
 from yt.mods import *
 from yt.data_objects.data_containers import YTDataContainer
@@ -16,8 +18,8 @@
 
 try:
     import IPython
-except:
-    print 'ipython is not available. using default python interpreter.'
+except ImportError:
+    print('ipython is not available. using default python interpreter.')
     import code
     import sys
     code.interact(doc, None, namespace)
@@ -70,7 +72,7 @@
 Feel free to edit this file to customize your ipython experience.
 
 Note that as such this file does nothing, for backwards compatibility.
-Consult e.g. file 'ipy_profile_sh.py' for an example of the things 
+Consult e.g. file 'ipy_profile_sh.py' for an example of the things
 you can do here.
 
 See http://ipython.scipy.org/moin/IpythonExtensionApi for detailed
@@ -96,7 +98,7 @@
 # http://pymel.googlecode.com/svn/trunk/tools/ipymel.py
 # We'll start with some fields.
 
-import re
+
 def yt_fieldname_completer(self, event):
     """Match dictionary completions"""
     #print "python_matches", event.symbol
@@ -110,7 +112,7 @@
 
     if not m:
         raise try_next
-    
+
     expr, attr = m.group(1, 3)
     #print "COMPLETING ON ", expr, attr
     #print type(self.Completer), dir(self.Completer)
@@ -122,9 +124,9 @@
         try:
             obj = eval(expr, self.Completer.global_namespace)
         except:
-            raise IPython.ipapi.TryNext 
-        
-    if isinstance(obj, (YTDataContainer, ) ):
+            raise IPython.ipapi.TryNext
+
+    if isinstance(obj, YTDataContainer):
         #print "COMPLETING ON THIS THING"
         all_fields = [f for f in sorted(
                 obj.ds.field_list + obj.ds.derived_field_list)]
@@ -135,6 +137,6 @@
 
     raise try_next
 
-ip.set_hook('complete_command', yt_fieldname_completer , re_key = ".*" )
+ip.set_hook('complete_command', yt_fieldname_completer, re_key = ".*")
 
 ip_shell.mainloop(**kwargs)

diff -r 9f8461c82f40422fce303ee43132a0c8b7afbc65 -r 1cc2beb515d168c04a39df000d33bd4f06f987d4 scripts/pr_backport.py
--- a/scripts/pr_backport.py
+++ b/scripts/pr_backport.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
 import hglib
 import requests
 import shutil
@@ -6,6 +7,7 @@
 from datetime import datetime
 from distutils.version import LooseVersion
 from time import strptime, mktime
+from yt.extern.six.moves import input
 
 MERGED_PR_ENDPOINT = ("http://bitbucket.org/api/2.0/repositories/yt_analysis/"
                       "yt/pullrequests/?state=MERGED")
@@ -280,17 +282,17 @@
             if commit_already_on_stable(repo_path, commits[0]) is True:
                 continue
             message = "hg graft %s\n" % commits[0]
-        print "PR #%s\nTitle: %s\nCreated on: %s\nLink: %s\n%s" % pr_desc
-        print "To backport, issue the following command(s):\n"
-        print message
-        raw_input('Press any key to continue')
+        print("PR #%s\nTitle: %s\nCreated on: %s\nLink: %s\n%s" % pr_desc)
+        print("To backport, issue the following command(s):\n")
+        print(message)
+        input('Press any key to continue')
 
 
 if __name__ == "__main__":
-    print ""
-    print "Gathering PR information, this may take a minute."
-    print "Don't worry, yt loves you."
-    print ""
+    print("")
+    print("Gathering PR information, this may take a minute.")
+    print("Don't worry, yt loves you.")
+    print("")
     repo_path = clone_new_repo()
     try:
         last_major_release = get_first_commit_after_last_major_release(repo_path)
@@ -308,11 +310,11 @@
         del inv_map[None]
 
         inv_map = screen_already_backported(repo_path, inv_map)
-        print "In another terminal window, navigate to the following path:"
-        print "%s" % repo_path
-        raw_input("Press any key to continue")
+        print("In another terminal window, navigate to the following path:")
+        print("%s" % repo_path)
+        input("Press any key to continue")
         backport_pr_commits(repo_path, inv_map, last_stable, prs)
-        raw_input(
+        input(
             "Now you need to push your backported changes. The temporary\n"
             "repository currently being used will be deleted as soon as you\n"
             "press any key.")

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