Module EDUtilsPlatform :: Class EDUtilsPlatform
[hide private]
[frames] | no frames]

Class EDUtilsPlatform

source code

object --+
         |
        EDUtilsPlatform

Static class for guessing: platform specific stuff.

Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
python string
getArchitecture(cls)
Returns the name of the architecture including the CPU arch and the version of python for the actual running python (i.e.
source code
python string
getSystemArchitecture(cls)
Returns the name of the architecture including the CPU arch and the version of python for the actual operating system
source code
python string
getName(cls)
Returns the name of the architecture
source code
 
getCmdSep(cls)
Returns the Command separator like ...
source code
 
getCmdEnv(cls)
Returns: "env" or "set" to print the environment under the current operating system
source code
 
getEscapedSep(cls)
return os.sep with "" escaped
source code
 
getEscapedLineSep(cls)
return os.linesep with "" escaped
source code
 
getLineSep(cls)
@return os.linesep
source code
 
getSep(cls)
Returns: os.sep
source code
 
getStartScript(cls)
Returns: header for writing scripts under the current the archtecture (#!/usr/bin/python under linux)
source code
 
getSize(cls)
Returns: the size of the environment, probably 32 or 64 bits
source code
 
getSystemPlatform(cls)
Returns: linux-x86_64, if python 32bits is running under amd64 OS.
source code
 
getPythonPlatform(cls)
Returns: linux-i386, if python 32bits is running under amd64 OS.
source code
 
getAltSep(cls)
Returns: os.altsep
source code
 
getExtSep(cls)
Returns: "." as extension separator
source code
 
getPathSep(cls)
same as os.pathsep @return "/" under linux and "" under windows.
source code
 
escape(cls, _string)
escape \ (i.e.
source code
 
Popen(cls, *args, **kwargs)
implementation of a platform independent subprocess.Popen method
source code
 
kill(cls, _iPid)
implementation of a platform independent kill method
source code
Class Variables [hide private]
  __semaphore = Semaphore()
  __strLineSep = '\n'
  __strSep = '/'
  __strAltSep = None
hash(x)
  __strExtSep = '.'
  __strPathSep = ':'
  __PythonPlatformSize = 64
  __SystemPlatform = 'linux-x86_64'
  __PythonPlatform = 'linux-x86_64'
  __PythonArchitecture = 'lib.linux-x86_64-2.7'
  __SystemArchitecture = 'lib.linux-x86_64-2.7'
  __strName = 'posix'
  __strCmdSep = ';'
  __strCmdEnv = 'env'
  __strEscapedSep = '\\\\'
  __strEscapedLineSep = '\\n'
  __strStartScript = '#!/usr/bin/python'
Properties [hide private]
  architecture
classmethod(function) -> method
  systemArchitecture
classmethod(function) -> method
  name
classmethod(function) -> method
  cmdSep
classmethod(function) -> method
  cmdEnv
classmethod(function) -> method
  escapedSep
classmethod(function) -> method
  escapedLinesep
classmethod(function) -> method
  linesep
classmethod(function) -> method
  sep
classmethod(function) -> method
  startScript
classmethod(function) -> method
  size
classmethod(function) -> method
  systemPlatform
classmethod(function) -> method
  pythonPlatform
classmethod(function) -> method
  altsep
classmethod(function) -> method
  extsep
classmethod(function) -> method
  pathsep
classmethod(function) -> method

Inherited from object: __class__

Method Details [hide private]

getArchitecture(cls)
Class Method

source code 

Returns the name of the architecture including the CPU arch and the version of python for the actual running python (i.e. can be i386 on a x86_64 computer)

Returns: python string
lib-$OS-$arch-$PyVersion

getSystemArchitecture(cls)
Class Method

source code 

Returns the name of the architecture including the CPU arch and the version of python for the actual operating system

Returns: python string
lib-$OS-$arch-$PyVersion

getName(cls)
Class Method

source code 

Returns the name of the architecture

Returns: python string
os.name like architecture (posix, nt, ... but never java even under jython)

getCmdSep(cls)
Class Method

source code 

Returns the Command separator like 
- Under Unix: cmd1;cmd2
- Under Windows cmd1 & cmd2 
@return: "&" or ";" depending on the architecture
@rtype: python string

getCmdEnv(cls)
Class Method

source code 
Returns:
"env" or "set" to print the environment under the current operating system

getSep(cls)
Class Method

source code 
Returns:
os.sep

getStartScript(cls)
Class Method

source code 
Returns:
header for writing scripts under the current the archtecture (#!/usr/bin/python under linux)

getSize(cls)
Class Method

source code 
Returns:
the size of the environment, probably 32 or 64 bits

getSystemPlatform(cls)
Class Method

source code 
Returns:
linux-x86_64, if python 32bits is running under amd64 OS.

getPythonPlatform(cls)
Class Method

source code 
Returns:
linux-i386, if python 32bits is running under amd64 OS.

getAltSep(cls)
Class Method

source code 
Returns:
os.altsep

getExtSep(cls)
Class Method

source code 
Returns:
"." as extension separator

escape(cls, _string)
Class Method

source code 

escape \ (i.e. "\") under windows as \ (i.e. "\\") @return escaped string suitable for metaprogramming

Popen(cls, *args, **kwargs)
Class Method

source code 

implementation of a platform independent subprocess.Popen method

Returns:
subporcess.Popen instance.

kill(cls, _iPid)
Class Method

source code 

implementation of a platform independent kill method

Parameters:
  • _iPid (integer) - process ID

Property Details [hide private]

architecture

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument,
just like an instance method receives the instance.
To declare a class method, use this idiom:

  class C:
      def f(cls, arg1, arg2, ...): ...
      f = classmethod(f)

It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()).  The instance is ignored except for its class.
If a class method is called for a derived class, the derived class
object is passed as the implied first argument.

Class methods are different than C++ or Java static methods.
If you want those, see the staticmethod builtin.

Get Method:
getArchitecture(cls) - Returns the name of the architecture including the CPU arch and the version of python for the actual running python (i.e.

systemArchitecture

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument,
just like an instance method receives the instance.
To declare a class method, use this idiom:

  class C:
      def f(cls, arg1, arg2, ...): ...
      f = classmethod(f)

It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()).  The instance is ignored except for its class.
If a class method is called for a derived class, the derived class
object is passed as the implied first argument.

Class methods are different than C++ or Java static methods.
If you want those, see the staticmethod builtin.

Get Method:
getSystemArchitecture(cls) - Returns the name of the architecture including the CPU arch and the version of python for the actual operating system

name

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument,
just like an instance method receives the instance.
To declare a class method, use this idiom:

  class C:
      def f(cls, arg1, arg2, ...): ...
      f = classmethod(f)

It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()).  The instance is ignored except for its class.
If a class method is called for a derived class, the derived class
object is passed as the implied first argument.

Class methods are different than C++ or Java static methods.
If you want those, see the staticmethod builtin.

Get Method:
getName(cls) - Returns the name of the architecture

cmdSep

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument,
just like an instance method receives the instance.
To declare a class method, use this idiom:

  class C:
      def f(cls, arg1, arg2, ...): ...
      f = classmethod(f)

It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()).  The instance is ignored except for its class.
If a class method is called for a derived class, the derived class
object is passed as the implied first argument.

Class methods are different than C++ or Java static methods.
If you want those, see the staticmethod builtin.

Get Method:
getCmdSep(cls) - Returns the Command separator like ...

cmdEnv

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument,
just like an instance method receives the instance.
To declare a class method, use this idiom:

  class C:
      def f(cls, arg1, arg2, ...): ...
      f = classmethod(f)

It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()).  The instance is ignored except for its class.
If a class method is called for a derived class, the derived class
object is passed as the implied first argument.

Class methods are different than C++ or Java static methods.
If you want those, see the staticmethod builtin.

Get Method:
getCmdEnv(cls) - Returns: "env" or "set" to print the environment under the current operating system

escapedSep

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument,
just like an instance method receives the instance.
To declare a class method, use this idiom:

  class C:
      def f(cls, arg1, arg2, ...): ...
      f = classmethod(f)

It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()).  The instance is ignored except for its class.
If a class method is called for a derived class, the derived class
object is passed as the implied first argument.

Class methods are different than C++ or Java static methods.
If you want those, see the staticmethod builtin.

Get Method:
getEscapedSep(cls) - return os.sep with "" escaped

escapedLinesep

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument,
just like an instance method receives the instance.
To declare a class method, use this idiom:

  class C:
      def f(cls, arg1, arg2, ...): ...
      f = classmethod(f)

It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()).  The instance is ignored except for its class.
If a class method is called for a derived class, the derived class
object is passed as the implied first argument.

Class methods are different than C++ or Java static methods.
If you want those, see the staticmethod builtin.

Get Method:
getEscapedLineSep(cls) - return os.linesep with "" escaped

linesep

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument,
just like an instance method receives the instance.
To declare a class method, use this idiom:

  class C:
      def f(cls, arg1, arg2, ...): ...
      f = classmethod(f)

It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()).  The instance is ignored except for its class.
If a class method is called for a derived class, the derived class
object is passed as the implied first argument.

Class methods are different than C++ or Java static methods.
If you want those, see the staticmethod builtin.

Get Method:
getLineSep(cls) - @return os.linesep

sep

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument,
just like an instance method receives the instance.
To declare a class method, use this idiom:

  class C:
      def f(cls, arg1, arg2, ...): ...
      f = classmethod(f)

It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()).  The instance is ignored except for its class.
If a class method is called for a derived class, the derived class
object is passed as the implied first argument.

Class methods are different than C++ or Java static methods.
If you want those, see the staticmethod builtin.

Get Method:
getSep(cls) - Returns: os.sep

startScript

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument,
just like an instance method receives the instance.
To declare a class method, use this idiom:

  class C:
      def f(cls, arg1, arg2, ...): ...
      f = classmethod(f)

It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()).  The instance is ignored except for its class.
If a class method is called for a derived class, the derived class
object is passed as the implied first argument.

Class methods are different than C++ or Java static methods.
If you want those, see the staticmethod builtin.

Get Method:
getStartScript(cls) - Returns: header for writing scripts under the current the archtecture (#!/usr/bin/python under linux)

size

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument,
just like an instance method receives the instance.
To declare a class method, use this idiom:

  class C:
      def f(cls, arg1, arg2, ...): ...
      f = classmethod(f)

It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()).  The instance is ignored except for its class.
If a class method is called for a derived class, the derived class
object is passed as the implied first argument.

Class methods are different than C++ or Java static methods.
If you want those, see the staticmethod builtin.

Get Method:
getSize(cls) - Returns: the size of the environment, probably 32 or 64 bits

systemPlatform

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument,
just like an instance method receives the instance.
To declare a class method, use this idiom:

  class C:
      def f(cls, arg1, arg2, ...): ...
      f = classmethod(f)

It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()).  The instance is ignored except for its class.
If a class method is called for a derived class, the derived class
object is passed as the implied first argument.

Class methods are different than C++ or Java static methods.
If you want those, see the staticmethod builtin.

Get Method:
getSystemPlatform(cls) - Returns: linux-x86_64, if python 32bits is running under amd64 OS.

pythonPlatform

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument,
just like an instance method receives the instance.
To declare a class method, use this idiom:

  class C:
      def f(cls, arg1, arg2, ...): ...
      f = classmethod(f)

It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()).  The instance is ignored except for its class.
If a class method is called for a derived class, the derived class
object is passed as the implied first argument.

Class methods are different than C++ or Java static methods.
If you want those, see the staticmethod builtin.

Get Method:
getPythonPlatform(cls) - Returns: linux-i386, if python 32bits is running under amd64 OS.

altsep

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument,
just like an instance method receives the instance.
To declare a class method, use this idiom:

  class C:
      def f(cls, arg1, arg2, ...): ...
      f = classmethod(f)

It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()).  The instance is ignored except for its class.
If a class method is called for a derived class, the derived class
object is passed as the implied first argument.

Class methods are different than C++ or Java static methods.
If you want those, see the staticmethod builtin.

Get Method:
getAltSep(cls) - Returns: os.altsep

extsep

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument,
just like an instance method receives the instance.
To declare a class method, use this idiom:

  class C:
      def f(cls, arg1, arg2, ...): ...
      f = classmethod(f)

It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()).  The instance is ignored except for its class.
If a class method is called for a derived class, the derived class
object is passed as the implied first argument.

Class methods are different than C++ or Java static methods.
If you want those, see the staticmethod builtin.

Get Method:
getExtSep(cls) - Returns: "." as extension separator

pathsep

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument,
just like an instance method receives the instance.
To declare a class method, use this idiom:

  class C:
      def f(cls, arg1, arg2, ...): ...
      f = classmethod(f)

It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()).  The instance is ignored except for its class.
If a class method is called for a derived class, the derived class
object is passed as the implied first argument.

Class methods are different than C++ or Java static methods.
If you want those, see the staticmethod builtin.

Get Method:
getPathSep(cls) - same as os.pathsep @return "/" under linux and "" under windows.