← Back to team overview

sikuli-driver team mailing list archive

[Bug 1864265] [NEW] Code example for Settings.getOS() contains error

 

Public bug reported:

<https://sikulix-2014.readthedocs.io/en/latest/globals.html#Settings.getOS>
provides two (similar) examples.  The former works fine but the latter
does not.


myOS = Settings.getOS()
if myOS == "MAC" or myOS.startswith("M"):
        print "Mac " + myVer # e.g., Mac 10.6.3
else:
        print "Sorry, not a Mac"


The variable myOS is just an int; comparing with str "MAC" does not make sense and calling startswith causes AttributeError.

** Affects: sikuli
     Importance: Undecided
         Status: New


** Tags: docs

** Description changed:

  <https://sikulix-2014.readthedocs.io/en/latest/globals.html#Settings.getOS>
  provides two (similar) examples.  The former works fine but the latter
  does not.
  
- <pre>myOS = Settings.getOS()
+ 
+ myOS = Settings.getOS()
  if myOS == "MAC" or myOS.startswith("M"):
-         print "Mac " + myVer # e.g., Mac 10.6.3
+         print "Mac " + myVer # e.g., Mac 10.6.3
  else:
-         print "Sorry, not a Mac"</pre>
+         print "Sorry, not a Mac"
  
- The variable myOS is just an int; comparing with str "MAC" does not make
- sense and calling startswith causes AttributeError.
+ 
+ The variable myOS is just an int; comparing with str "MAC" does not make sense and calling startswith causes AttributeError.

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1864265

Title:
  Code example for Settings.getOS() contains error

Status in Sikuli:
  New

Bug description:
  <https://sikulix-2014.readthedocs.io/en/latest/globals.html#Settings.getOS>
  provides two (similar) examples.  The former works fine but the latter
  does not.

  
  myOS = Settings.getOS()
  if myOS == "MAC" or myOS.startswith("M"):
          print "Mac " + myVer # e.g., Mac 10.6.3
  else:
          print "Sorry, not a Mac"

  
  The variable myOS is just an int; comparing with str "MAC" does not make sense and calling startswith causes AttributeError.

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1864265/+subscriptions


Follow ups