Skip to content

Commit 0178e75

Browse files
committed
Whitespace cleanup and remove non-canonical headers
llvm-svn: 222135
1 parent 9251e2e commit 0178e75

File tree

1 file changed

+43
-51
lines changed

1 file changed

+43
-51
lines changed

lldb/scripts/utilsOsType.py

Lines changed: 43 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,17 @@
11
""" Utility module to determine the OS Python running on
22
3-
--------------------------------------------------------------------------
4-
File: utilsOsType.py
3+
--------------------------------------------------------------------------
4+
File: utilsOsType.py
55
6-
Overview: Python module to supply functions and an enumeration to
7-
help determine the platform type, bit size and OS currently
8-
being used.
9-
10-
Environment: OS: Windows/LINUX/OSX
11-
IDE: Visual Studio 2013 Plugin Python Tools (PTVS)
12-
Script: Python 2.6 x64
6+
Overview: Python module to supply functions and an enumeration to
7+
help determine the platform type, bit size and OS currently
8+
being used.
9+
--------------------------------------------------------------------------
1310
14-
Gotchas: None.
15-
16-
Copyright: None.
17-
--------------------------------------------------------------------------
18-
1911
"""
2012

2113
# Python modules:
22-
import sys # Provide system information
14+
import sys # Provide system information
2315

2416
# Third party modules:
2517

@@ -29,54 +21,54 @@
2921

3022
# Enumerations:
3123
#-----------------------------------------------------------------------------
32-
# Details: Class to implement a 'C' style enumeration type.
33-
# Gotchas: None.
34-
# Authors: Illya Rudkin 28/11/2013.
35-
# Changes: None.
24+
# Details: Class to implement a 'C' style enumeration type.
25+
# Gotchas: None.
26+
# Authors: Illya Rudkin 28/11/2013.
27+
# Changes: None.
3628
#--
3729
class EnumOsType( object ):
38-
values = [ "Unknown",
39-
"Windows",
40-
"Linux",
41-
"Darwin" ]; # OSX
42-
class __metaclass__( type ):
30+
values = [ "Unknown",
31+
"Windows",
32+
"Linux",
33+
"Darwin" ]; # OSX
34+
class __metaclass__( type ):
4335
#++---------------------------------------------------------------------------
44-
# Details: Fn acts as an enumeration.
45-
# Args: vName - (R) Enumeration to match.
46-
# Returns: Int - Matching enumeration/index.
47-
# Throws: None.
36+
# Details: Fn acts as an enumeration.
37+
# Args: vName - (R) Enumeration to match.
38+
# Returns: Int - Matching enumeration/index.
39+
# Throws: None.
4840
#--
49-
def __getattr__( self, vName ):
50-
return self.values.index( vName );
41+
def __getattr__( self, vName ):
42+
return self.values.index( vName );
5143

5244
#++---------------------------------------------------------------------------
53-
# Details: Reverse fast lookup of the values list.
54-
# Args: vI - (R) Index / enumeration.
55-
# Returns: Str - text description matching enumeration.
56-
# Throws: None.
45+
# Details: Reverse fast lookup of the values list.
46+
# Args: vI - (R) Index / enumeration.
47+
# Returns: Str - text description matching enumeration.
48+
# Throws: None.
5749
#--
58-
def name_of( self, vI ):
59-
return EnumOsType.values[ vI ];
50+
def name_of( self, vI ):
51+
return EnumOsType.values[ vI ];
6052

6153
#-----------------------------------------------------------------------------
6254
#-----------------------------------------------------------------------------
6355
#-----------------------------------------------------------------------------
6456

6557
#++---------------------------------------------------------------------------
66-
# Details: Determine what operating system is currently running on.
67-
# Args: None.
68-
# Returns: EnumOsType - The OS type being used ATM.
69-
# Throws: None.
58+
# Details: Determine what operating system is currently running on.
59+
# Args: None.
60+
# Returns: EnumOsType - The OS type being used ATM.
61+
# Throws: None.
7062
#--
7163
def determine_os_type():
72-
eOSType = EnumOsType.Unknown;
73-
74-
strOS = sys.platform
75-
if strOS == "win32":
76-
eOSType = EnumOsType.Windows;
77-
elif (strOS == "linux") or (strOS == "linux2"):
78-
eOSType = EnumOsType.Linux;
79-
elif strOS == "darwin":
80-
eOSType == EnumOsType.Darwin;
81-
82-
return eOSType;
64+
eOSType = EnumOsType.Unknown;
65+
66+
strOS = sys.platform
67+
if strOS == "win32":
68+
eOSType = EnumOsType.Windows;
69+
elif (strOS == "linux") or (strOS == "linux2"):
70+
eOSType = EnumOsType.Linux;
71+
elif strOS == "darwin":
72+
eOSType == EnumOsType.Darwin;
73+
74+
return eOSType;

0 commit comments

Comments
 (0)