server/sources/native.py
branchstable
changeset 8910 7652c3d46ba3
parent 8821 c4aa23af0baa
child 8916 2a424950463d
equal deleted inserted replaced
8909:f46b017db2d9 8910:7652c3d46ba3
     1 # copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     1 # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     3 #
     3 #
     4 # This file is part of CubicWeb.
     4 # This file is part of CubicWeb.
     5 #
     5 #
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
  1713 
  1713 
  1714     def get_connection(self):
  1714     def get_connection(self):
  1715         return self._source.get_connection()
  1715         return self._source.get_connection()
  1716 
  1716 
  1717     def backup(self, backupfile):
  1717     def backup(self, backupfile):
  1718         archive=zipfile.ZipFile(backupfile, 'w', allowZip64=True)
  1718         archive = zipfile.ZipFile(backupfile, 'w', allowZip64=True)
  1719         self.cnx = self.get_connection()
  1719         self.cnx = self.get_connection()
  1720         try:
  1720         try:
  1721             self.cursor = self.cnx.cursor()
  1721             self.cursor = self.cnx.cursor()
  1722             self.cursor.arraysize=100
  1722             self.cursor.arraysize=100
  1723             self.logger.info('writing metadata')
  1723             self.logger.info('writing metadata')
  1748             if eschema.final:
  1748             if eschema.final:
  1749                 continue
  1749                 continue
  1750             etype_tables.append('%s%s'%(prefix, etype))
  1750             etype_tables.append('%s%s'%(prefix, etype))
  1751         for rtype in self.schema.relations():
  1751         for rtype in self.schema.relations():
  1752             rschema = self.schema.rschema(rtype)
  1752             rschema = self.schema.rschema(rtype)
  1753             if rschema.final or rschema.inlined:
  1753             if rschema.final or rschema.inlined or rschema in VIRTUAL_RTYPES:
  1754                 continue
  1754                 continue
  1755             relation_tables.append('%s_relation' % rtype)
  1755             relation_tables.append('%s_relation' % rtype)
  1756         return non_entity_tables + etype_tables + relation_tables
  1756         return non_entity_tables + etype_tables + relation_tables
  1757 
  1757 
  1758     def get_sequences(self):
  1758     def get_sequences(self):