[openbox] [PATCH] fix "print" syntax for python 3

Brian Mattern rephorm at rephorm.com
Wed Apr 17 15:23:58 EDT 2013


I almost sent the same email, but it turns out (in this case) to be
unnecessary since `print (a+b)` parses to `print a+b` (with the parens
being simply an unnecessary grouping).

But, it would probably still be good to include the import in case these
lines get modified in the future.

Brian

On Wed, 17 Apr 2013, John Eikenberry wrote:

> You might want to include..
> 
> from __future__ import print_function
> 
> ..at the top of that to maintain backwards compatibility with 2.7.
> 
> Jim Rees wrote:
> 
> > Signed-off-by: Jim Rees <rees at umich.edu>
> > ---
> >  data/autostart/openbox-xdg-autostart | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/data/autostart/openbox-xdg-autostart b/data/autostart/openbox-xdg-autostart
> > index 04a17a1..6479903 100755
> > --- a/data/autostart/openbox-xdg-autostart
> > +++ b/data/autostart/openbox-xdg-autostart
> > @@ -51,7 +51,7 @@ def main(argv=sys.argv):
> >              try:
> >                  autofile = AutostartFile(path)
> >              except ParsingError:
> > -                print "Invalid .desktop file: " + path
> > +                print ("Invalid .desktop file: " + path)
> >              else:
> >                  if not autofile in files:
> >                      files.append(autofile)
> > @@ -146,9 +146,9 @@ class AutostartFile:
> >  
> >      def display(self, envs):
> >          if self._shouldRun(envs):
> > -            print "[*] " + self.de.getName()
> > +            print ("[*] " + self.de.getName())
> >          else:
> > -            print "[ ] " + self.de.getName()
> > +            print ("[ ] " + self.de.getName())
> >          self._alert("File: " + self.path, info=True)
> >          if self.de.getExec():
> >              self._alert("Executes: " + self.de.getExec(), info=True)
> 
> -- 
> 
> John Eikenberry
> [ jae at zhar.net - http://zhar.net ]
> [ PGP public key @ http://zhar.net/jae_at_zhar_net.gpg ]
> ________________________________________________________________________
> Sic gorgiamus allos subjectatos nunc



> _______________________________________________
> openbox mailing list
> openbox at icculus.org
> http://icculus.org/mailman/listinfo/openbox



More information about the openbox mailing list