Package Ganga :: Package Lib :: Package Mergers :: Module Merger :: Class TextMerger :: Class _proxyClass
[hide private]
[frames] | no frames]

Class _proxyClass

source code

    object --+    
             |    
GPIProxyObject --+
                 |
                Lib.Mergers.Merger.TextMerger._proxyClass

Merger class for text

    TextMerger will append specified text files in the order that they are
    encountered in the list of Jobs. Each file will be separated by a header
    giving some very basic information about the individual files.

    Usage:

    tm = TextMerger()
    tm.files = ['job.log','results.txt']
    tm.overwrite = True #False by default
    tm.ignorefailed = True #False by default

    # will produce the specified files
    j = Job() 
    j.outputsandbox = ['job.log','results.txt']
    j.splitter = SomeSplitter()
    j.merger = tm
    j.submit()

    The merge object will be used to merge the output of
    each subjob into j.outputdir. This will be run when
    the job completes. If the ignorefailed flag has been set
    then the merge will also be run as the job enters the
    killed or failed states.
    
    The above merger object can also be used independently
    to merge a list of jobs or the subjobs of an single job.

    #tm defined above
    tm.merge(j, outputdir = '~/merge_dir')
    tm.merge([.. list of jobs ...], '~/merge_dir', ignorefailed = True, overwrite = False)

    If ignorefailed or overwrite are set then they override the values set on the
    merge object.

    If outputdir is not specified, the default location specfied
    in the [Mergers] section of the .gangarc file will be used.

    For large text files it may be desirable to compress the merge
    result using gzip. This can be done by setting the compress
    flag on the TextMerger object. In this case, the merged file
    will have a '.gz' appended to its filename.

    A summary of all the files merged will be created for each entry in files.
    This will be created when the merge of those files completes
    successfully. The name of this is the same as the output file, with the
    '.merge_summary' extension appended and will be placed in the same directory
    as the merge results.

    

Properties:

     files        A list of files to merge.. (simple property, list,
                  default=[],comparable)

     compress     Output should be compressed with gzip.. (simple property,
                  default=False,comparable)

     ignorefailed Jobs that are in the failed or killed states will be excluded
                  from the merge when this flag is set to True.. (simple
                  property, default=False,comparable)

     overwrite    The default behaviour for this Merger object. Will overwrite
                  output files.. (simple property, default=False,comparable)

Nested Classes [hide private]
  _impl
This is a Ganga.GPI.TextMerger implementation class.
Instance Methods [hide private]
 
__eq__(self, x)
Equality operator (==), compare the TextMerger properties which are declared as [comparable].
source code
 
__init__(self, *args, **kwds)
GPI TextMerger object constructor: TextMerger() : create textmerger with default settings; TextMerger(t) : make a copy of t; TextMerger(t,x=a,...): make a copy of t and set property 'x' to a, etc..
source code
 
__ne__(self, x)
Non-equality operator (!=).
source code
 
__repr__(self)
Return an short representation of TextMerger object.
source code
 
__setattr__(self, x, v)
Set a property of TextMerger with consistency and safety checks.
source code
 
__str__(self)
Return a printable string representing TextMerger object as a tree of properties.
source code
 
copy(self)
Make an identical copy of self.
source code
 
merge(...) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __sizeof__, __subclasshook__

Class Variables [hide private]
  compress = <Ganga.GPIDev.Base.Proxy.ProxyDataDescriptor object...
  files = <Ganga.GPIDev.Base.Proxy.ProxyDataDescriptor object at...
  ignorefailed = <Ganga.GPIDev.Base.Proxy.ProxyDataDescriptor ob...
  overwrite = <Ganga.GPIDev.Base.Proxy.ProxyDataDescriptor objec...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kwds)
(Constructor)

source code 

GPI TextMerger object constructor: TextMerger() : create textmerger with default settings; TextMerger(t) : make a copy of t; TextMerger(t,x=a,...): make a copy of t and set property 'x' to a, etc..

Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

Return an short representation of TextMerger object.

Overrides: object.__repr__

__setattr__(self, x, v)

source code 

Set a property of TextMerger with consistency and safety checks. Setting a [protected] or a unexisting property raises AttributeError.

Overrides: object.__setattr__

__str__(self)
(Informal representation operator)

source code 

Return a printable string representing TextMerger object as a tree of properties.

Overrides: object.__str__

Class Variable Details [hide private]

compress

Value:
<Ganga.GPIDev.Base.Proxy.ProxyDataDescriptor object at 0x17f7850>

files

Value:
<Ganga.GPIDev.Base.Proxy.ProxyDataDescriptor object at 0x17f7790>

ignorefailed

Value:
<Ganga.GPIDev.Base.Proxy.ProxyDataDescriptor object at 0x17f78d0>

overwrite

Value:
<Ganga.GPIDev.Base.Proxy.ProxyDataDescriptor object at 0x17f7950>