gear_mc
 All Classes Namespaces Functions Variables
Namespaces | Classes | Functions | Variables
gear Namespace Reference

main gear module with core method for logging and reloading library More...

Namespaces

 encode
 encode / decode data
 
 lists
 
 screen
 screen related methods
 
 string
 list management methods
 
 xmldom
 xml management methods. Work with the cElementTree module
 
 xsi
 main xsi module, xsi constants, preferences mangement
 

Classes

class  FakeException
 Exception. More...
 

Functions

def logInfos
 Log version of Gear.
 
def getVersion
 
def reloadModule
 METHODS. More...
 
def setDebug
 LOGGER. More...
 
def toggleDebug
 Toggle the debug mode value. More...
 
def log
 Log a message using severity and additional info from the file itself. More...
 
def getInfos
 Get information from where the method has been fired. More...
 

Variables

tuple xsi_application = Dispatch("XSI.Application")
 
 logDebug = False
 Debug mode for the logger.
 
int sev_fatal = 1
 
int sev_error = 2
 
int sev_warning = 4
 
int sev_info = 8
 
int sev_verbose = 16
 
int sev_comment = 32
 
list VERSION = [1,1,1]
 

Detailed Description

main gear module with core method for logging and reloading library

    This file is part of GEAR_mc.
    GEAR_mc is a fork of Jeremie Passerin's GEAR project.

    GEAR is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/lgpl.html>.

    Author:     Jeremie Passerin    geerem@hotmail.com  www.jeremiepasserin.com
    Fork Author:  Miquel Campos       hello@miqueltd.com  www.miqueltd.com
    Date:       2013 / 08 / 16
Author
Jeremie Passerin

Function Documentation

def gear.getInfos (   level)

Get information from where the method has been fired.


Such as module name, method, line number...

Parameters
level
Returns
String
def gear.log (   message,
  severity = sev_comment,
  infos = False 
)

Log a message using severity and additional info from the file itself.


Severity has been taken from Softimage one :
1.Fatal
2.Error
4.Warning
8.Info
16.Verbose
32.Comment

Parameters
messageString
severityInt4
infosBoolean - Add extra infos from the module, class, method and line number.
def gear.reloadModule (   name = "gear",
  silent = True 
)

METHODS.

======================================================== reload a module and its sub-modules from a given module name.

Parameters
nameString - The name of the module to reload.
def gear.setDebug (   b)

LOGGER.

======================================================== Set the debug mode to given value.

Parameters
bBoolean
Returns
Boolean - The previous value of the debug mode
def gear.toggleDebug ( )

Toggle the debug mode value.

Parameters
Boolean- The new debug mode value.