| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DybPython::dbcmd::MySQLLoad Class Reference

Inheritance diagram for DybPython::dbcmd::MySQLLoad:
[legend]
Collaboration diagram for DybPython::dbcmd::MySQLLoad:
[legend]
List of all members.

Public Member Functions

def __call__
def __init__
def __str__
def __call__

Static Public Attributes

tuple exepath = property( _exepath )
tuple cmd = property( lambda self:self._cmd % self )
tuple cmd_nopw = property( lambda self:self._cmd % dict(self, password="***") )

Static Private Attributes

list _exenames = ['mysql','mysql5']
string _cmd = "cat %(path)s | %(exepath)s --no-defaults --host=%(host)s --user=%(user)s --password=%(password)s %(database)s "

Detailed Description

Wrapper around sql loading commandline that hooks up to the 
config parameters from the :file:`~/.my.cnf` 

Definition at line 34 of file dbcmd.py.


Member Function Documentation

def DybPython::dbcmd::MySQLLoad::__call__ (   self,
  path,
  verbose = True 
)

Arguments are used to update the tables list and dumppath 

Definition at line 39 of file dbcmd.py.

00042                                            :
00043         """Arguments are used to update the tables list and dumppath """
00044         assert os.path.exists(path),  "MySQLLoad ERROR no mysqldump file at %s " % path
00045         assert self['database'].startswith('tmp_'), "MySQLLoad error invalid database name %r " % self 
00046         self.update( path=path )
        return CommandLine.__call__(self, verbose=verbose) 

def DybPython::dbcmd::CommandLine::__init__ (   self,
  args,
  kwa 
) [inherited]

Definition at line 17 of file dbcmd.py.

00017                                     :self._cmd % dict(self, password="***") )
00018 
00019     def __init__(self, *args, **kwa ):
00020         dict.__init__(self, *args, **kwa )
00021         exe = self.exepath
00022         assert exe, "cannot find executable %r check your PATH " % self._exenames

def DybPython::dbcmd::CommandLine::__str__ (   self  )  [inherited]

Definition at line 23 of file dbcmd.py.

00025                      :
        return "%s %s " % (self.__class__.__name__, self.cmd_nopw )

def DybPython::dbcmd::CommandLine::__call__ (   self,
  verbose = False 
) [inherited]

Definition at line 26 of file dbcmd.py.

00028                                      :
00029         if verbose:
00030             print self
00031         return os.popen(self.cmd).read()        


Member Data Documentation

list DybPython::dbcmd::MySQLLoad::_exenames = ['mysql','mysql5'] [static, private]

Definition at line 36 of file dbcmd.py.

string DybPython::dbcmd::MySQLLoad::_cmd = "cat %(path)s | %(exepath)s --no-defaults --host=%(host)s --user=%(user)s --password=%(password)s %(database)s " [static, private]

Definition at line 37 of file dbcmd.py.

tuple DybPython::dbcmd::CommandLine::exepath = property( _exepath ) [static, inherited]

Definition at line 13 of file dbcmd.py.

tuple DybPython::dbcmd::CommandLine::cmd = property( lambda self:self._cmd % self ) [static, inherited]

Definition at line 14 of file dbcmd.py.

tuple DybPython::dbcmd::CommandLine::cmd_nopw = property( lambda self:self._cmd % dict(self, password="***") ) [static, inherited]

Definition at line 15 of file dbcmd.py.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:13:02 2011 for DybPython by doxygen 1.4.7