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

In This Package:

DybPython::dbcmd::MySQLDump Class Reference

Inheritance diagram for DybPython::dbcmd::MySQLDump:
[legend]
Collaboration diagram for DybPython::dbcmd::MySQLDump:
[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 = ['mysqldump','mysqldump5']
string _cmd = "time %(exepath)s --no-defaults --skip-opt --host=%(host)s --user=%(user)s --password=%(password)s %(database)s %(argline)s > %(path)s "

Detailed Description

Wrapper around a mysqldump command line that integrates 
config parameters from the :file:`~/.my.cnf` with table list and
dumppath call arguments.
  
For background on mysqldump see http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html

Options used with  the mysqldump command  includes `--no-defaults` which   
ensures the command is fully controlled by this script and does not depend on 
users defaults. Also the `--skip-opt` is used to avoid an error when used by 
with mysql identities without LOCK TABLES privilege::
  
    mysqldump: Got error: 1044: Access denied for user 'dayabay'@'%' to database 'offline_db' when doing LOCK TABLES

Definition at line 87 of file dbcmd.py.


Member Function Documentation

def DybPython::dbcmd::MySQLDump::__call__ (   self,
  tables,
  dumppath,
  verbose = True 
)

Arguments are used to update the tables list and dumppath 

Definition at line 92 of file dbcmd.py.

00093                                         ://dev.mysql.com/doc/refman/5.0/en/mysqldump.html
00094 
00095     Options used with  the mysqldump command  includes `--no-defaults` which   
00096     ensures the command is fully controlled by this script and does not depend on 
00097     users defaults. Also the `--skip-opt` is used to avoid an error when used by 
00098     with mysql identities without LOCK TABLES privilege::

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::MySQLDump::_exenames = ['mysqldump','mysqldump5'] [static, private]

Definition at line 89 of file dbcmd.py.

string DybPython::dbcmd::MySQLDump::_cmd = "time %(exepath)s --no-defaults --skip-opt --host=%(host)s --user=%(user)s --password=%(password)s %(database)s %(argline)s > %(path)s " [static, private]

Definition at line 90 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