Renamed cellgroup.py and CellConstraint.
[pseudoku.git] / pseudoku / grid / constraints.py
similarity index 95%
rename from pseudoku/grid/cellgroup.py
rename to pseudoku/grid/constraints.py
index 841a490..91f8287 100644 (file)
@@ -2,7 +2,7 @@ from __future__ import division
 
 from weakref import ref
 
-class CellConstraint(object):
+class Constraint(object):
     """Represents any group of cells in a grid that cannot repeat a digit."""
 
     ### Accessors
@@ -46,7 +46,7 @@ class CellConstraint(object):
             target_cell.set(value)
 
 
-class Box(CellConstraint):
+class Box(Constraint):
     def _get_box_row(self):
         return self._pos // self.grid._box_width
     box_row = property(_get_box_row)
@@ -67,7 +67,7 @@ class Box(CellConstraint):
                 self._cells.append(ref(self.grid.cell(cell_row, cell_col)))
 
 
-class Row(CellConstraint):
+class Row(Constraint):
     def __init__(self, grid, position):
         self._grid = ref(grid)
         self._pos = position
@@ -76,7 +76,7 @@ class Row(CellConstraint):
         for col in xrange(self.grid._size):
             self._cells.append(ref(self.grid.cell(self._pos, col)))
 
-class Column(CellConstraint):
+class Column(Constraint):
     def __init__(self, grid, position):
         self._grid = ref(grid)
         self._pos = position
@@ -85,7 +85,7 @@ class Column(CellConstraint):
         for row in xrange(self.grid._size):
             self._cells.append(ref(self.grid.cell(row, self._pos)))
 
-class Diagonal(CellConstraint):
+class Diagonal(Constraint):
     def __init__(self, grid, direction='down', offset=0):
         self._grid = ref(grid)
         self._direction = direction