MCPcopy Index your code
hub / github.com/clips/pattern / _set_name

Method _set_name

pattern/db/__init__.py:861–872  ·  view source on GitHub ↗
(self, name)

Source from the content-addressed store, hash-verified

859 def _get_name(self):
860 return self._name
861 def _set_name(self, name):
862 # Rename the table in the database and in any Database.relations.
863 # SQLite and MySQL will automatically copy indices on the new table.
864 self.db.execute("alter table `%s` rename to `%s`;" % (self._name, name))
865 self.db.tables.pop(self._name)
866 self.db.tables[name] = self
867 for i, r in enumerate(self.db.relations):
868 if r[0] == self._name:
869 self.db.relations = (name, r[1], r[2], r[3])
870 if r[2] == self.name:
871 self.db.relations = (r[0], r[1], name, r[3])
872 self._name = name
873
874 name = property(_get_name, _set_name)
875

Callers

nothing calls this directly

Calls 2

executeMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected