Metadata-Version: 1.1
Name:UnderscoreX
Version:0.0.1r001a-yusut-bozlon
Author:Patrick Riendeau
Author-email:maxistedeams at gmail com, p_riendeau at live ca, rheault etccy at gmail com
Maintainer:Maxiste Deams
Maintainer-email:maxistedeams at gmail com, p_riendeau at live ca, rheault etccy at gmail com
Home-page:http://github.com/priendeau/UnderscoreX
Download-url:https://github.com/priendeau/UnderscoreX.git
url:https://github.com/priendeau/UnderscoreX
Summary:DecoratorClass used to parse **Kargs and handle Warning and exception thru Missing Attribute by adding static Decorator.
License:Copyright (c) 2004-2012, Maxiste Deams, alis Patrick Riendeau.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of the <organization> nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Description:This structure is intended for The developper developping pass-thru and conviviable method to 
        intercept attribut on demande by passing information from **kwargs or mutiple-string-chained argument.
        
                ------------
            This allow to build and easy model assuming you had readed the example. It offer a easy chaining method
            Thru decorator to parse incoming information from **kwargs or any multi-chained string. Once you have 
            defined a correct dictrionary of Attentend Attribute and Messages dedicated to inform the developper. 
            It contains a mechanism to push into warning or error the missing attribute informaitons. Rather to
            code individually all the missing attribute and condition, and exception class is provided as example.
        
        
        Installing
        ==========
                ------------
          Under Development.
          
          You can download the latest versions released from <<No pypi for the moment, crude develpt and 
          in correct stuff will cause problem and rejection, but maxistedeams will release it >>
          or download the development version straight from the Github repository hosted by me at:
          git://github.com/priendeau/UnderscoreX.git
        
        Documentation
        =============
          Is currently lacking, about every method is documented in the source. But future prototype will
          become move and more verbosis and Final realse will include test-case and a lot of documentation.
long-description:UnderscoreX

This is a set of Class and decorator to parse many type of argument.

This structure is intended for The developper developping pass-thru and conviviable method to intercept attribut on demande by passing information from **kwargs or mutiple-string-chained argument.

This allow to build and easy model assuming you had readed the example. It offer a easy chaining method
Thru decorator to parse incoming information from **kwargs or any multi-chained string. Once you have 
defined a correct dictrionary of Attentend Attribute and Messages dedicated to inform the developper. 
It contains a mechanism to push into warning or error the missing attribute informaitons. Rather to
code individually all the missing attribute and condition, and exception class is provided as example.

Installing

Under Development.

You can download the latest versions released from <> or download the development version straight from the Github repository hosted by me at: git://github.com/priendeau/UnderscoreX.git
Documentation

Is currently lacking, about every method is documented in the source. But future prototype will become move and more verbosis and Final realse will include test-case and a lot of documentation.

Example 
=============
::
		Generic Exception class model:

		Basics
		------
		We need 2 Class to store attribute:

		class ObjectGenericWarningHolder( object ):

		  def __init__( self ):
		    print "Add Current Object Attribute %s" % self.__class__.__name__

		class ObjectGenericAttrHolder( object ):

		  def __init__( self ):
		    print "Add Current Object Attribute %s" % self.__class__.__name__


		We Need a Generic Exception class like this one.


		class ExceptionGenericAttrMissing( Exception ):

		  msg                             ='__GENERIC_EXCEPTION_MESSAGES__'
		  AttrCurrentExceptionHandled     = None
		  HadDecoderTypeList              = False 

		  def __Init__Attr( self , value ):
		    self.AttrCurrentExceptionHandled = value
		    DictListTemplateKey="%sList" % ( value )
		    IsListTemplateKey="Had%sList" % ( value )
		    if hasattr( self, IsListTemplateKey  ):
		      if getattr( self, IsListTemplateKey ) == True:
		        Exception.__init__( self, self.MsgDict[DictListTemplateKey] % ( self.AttrCurrentExceptionHandled ,
		                                                                getattr( self, DictListTemplateKey ) ) )
		      else:
		        Exception.__init__( self, self.MsgDict[self.AttrCurrentExceptionHandled]  % ( self.AttrCurrentExceptionHandled ) )


		  @_XDecoratorWrapper.Kargs2Attr( ObjectWarningHolder )
		  def __init__( self, **Kargs ):
		    if hasattr( self, 'ListAttrFuncAccess' ):
		      print "Available message for following Attr:[ %s ]" % ( self.ListAttrFuncAccess ) 
		    self.RaisedExceptionByAttr = False
		    for ExceptionByAttr in self.ListAttrFuncAccess:
		      if hasattr( self, ExceptionByAttr ):
		        self.RaisedExceptionByAttr = True
		        getattr( self, "__Init__Attr")( ExceptionByAttr )

		###
		### Main class:
		### 

		class GenericTest( object ):

		  MsgDict = {
		    'AppsName'        :'Internal Value AppsName not used, You should at least Specified an AppsName Value.',
		    'ActionHelper'    :'Internal Value ActionHelper not used, You should at least Specified an ActionHelper Value.',
		    'HelperSwitch'    :'Internal Value HelperSwitch not used, You should at least Specified an HelperSwitch Value.',
		  }  

		  OptionListDiscovery=list()
		  TempOptionList=list()
		  ErrorHandler = iterpipes.CalledProcessError

		  ListAttrFuncAccess        = [ 'AppsName', 'ActionHelper', 'HelperSwitch' ]
		  parser = OptionParser()

		  def __start_cmdline_parser__( self ):

		    self.parser.add_option("-A", "--AppsName",
		                      dest="StrAppsName",
		                      help="Add AppsName in your Class")
		    self.parser.add_option("-J", "--ActionHelper",
		                      dest="StrActionHelper",
		                      help="Add ActionHelper in your Class")
		    self.parser.add_option("-S", "--HelperSwitch",
		                      dest="StrHelperSwitch",
		                      help="Add HelperSwitch in your Class ")


		  @_XDecoratorWrapper.Kargs2AttrPreException( ObjectIterAppsFilter )
		  def __init__( self , **Kargs ):
		    self.__start_cmdline_parser__()
		    (self.options, self.args ) = self.parser.parse_args() 
		    self.ErrorRaiser( )
		### ...


		  @_XDecoratorWrapper.ObjectClassRaiser( ObjectGenericAttrHolder , ExceptionGenericAttrMissing )
		  def ErrorRaiser( self ):
		    print "Inspecting Missing Attribute."



		### Some Instantiation statement:

		if __name__.__eq__( '__main__' ):
		  _XDecoratorWrapper.ErrorClassReceivedAttrListName = 'ListAttrFuncAccess'
		  ExceptionGenericAttrMissing.ListAttrFuncAccess    = ItertAppsFilter.ListAttrFuncAccess
		  ExceptionGenericAttrMissing.MsgDict               = ItertAppsFilter.MsgDict
		  Ainstance=GenericTest( AppsName=None, ActionHelper=None, HelperSwitch=None )

		And We have Correct basic model of Attribute filtering thru the **kargs and will raise any Warning or exception
		upon definition of your class inside the Object Raiser inside _XDecoratorWrapper :
		--------
		@_XDecoratorWrapper.ObjectClassRaiser( __ANY_EXCEPTION_OR_WARNING_OBJECT__ , ExceptionGenericAttrMissing )
		def ErrorRaiser( self ):
		 pass 

Platform:Windows
Linux
Unix
Requires:sets
Requires:iterpipes
Provides:_XDecoratorWrapper
Classifier:Development Status :: 3 - Alpha
Classifier:Environment :: MacOS X
Classifier:Environment :: Win32 (MS Windows)
Classifier:Intended Audience :: Developers
Classifier:License :: OSI Approved :: BSD License
Classifier:Natural Language :: English
Classifier:Operating System :: MacOS :: MacOS X
Classifier:Operating System :: Microsoft
Classifier:Operating System :: Microsoft :: Windows :: Windows 7
Classifier:Operating System :: Microsoft :: Windows :: Windows XP
Classifier:Operating System :: Other OS
Classifier:Operating System :: POSIX
Classifier:Operating System :: POSIX :: BSD
Classifier:Operating System :: POSIX :: Linux
Classifier:Operating System :: POSIX :: Other
Classifier:Programming Language :: Python
Classifier:Programming Language :: Python :: 2.6
Classifier:Programming Language :: Python :: 2.7
Classifier:Programming Language :: Python :: Implementation


