1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| class TestListModel(QAbstractListModel):
def __init__(self, parent=None):
QAbstractListModel.__init__(self, parent)
self.testnames = []
def load_docfiles(self):
cfg = Config()
for filename in glob.glob(os.path.join(cfg.test_path, 'test_*.rst')):
self.testnames = os.path.basename(filename)[5:-4]
filepath = os.path.abspath(filename)
print "load docfile", str(self.testnames)
return str(self.testnames)
def rowCount(self, index):
return len(self.testnames)
def data(self, index, role):
if role == Qt.DisplayRole:
cfg = Config()
for filename in glob.glob(os.path.join(cfg.test_path, 'test_*.rst')):
self.testnames = os.path.basename(filename)[:-4]
filepath = os.path.abspath(filename)
return self.testnames
def columnCount(self, index):
pass |
Partager