diff options
Diffstat (limited to 'examples3/tablestatistics.py')
-rwxr-xr-x | examples3/tablestatistics.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/examples3/tablestatistics.py b/examples3/tablestatistics.py index e0835bb..d6b6b2e 100755 --- a/examples3/tablestatistics.py +++ b/examples3/tablestatistics.py @@ -53,6 +53,8 @@ class Table(TQTable): # read all the TQt source and header files into a list all = [] qtdir = os.getenv("TQTDIR") + if qtdir is None: + raise Exception("The TQTDIR environment variable has not been set.") for i in dirs: dir = TQDir(os.path.join(qtdir, "src", i)) lst = TQStringList(dir.entryList("*.cpp; *.h")) @@ -65,7 +67,7 @@ class Table(TQTable): self.setNumRows(len(all) + 1) i = 0 - sum = 0L + sum = 0 # insert the data into the table for it in all: self.setText(i, TB_FILE, it) @@ -82,11 +84,11 @@ class Table(TQTable): if col < TB_SIZE or col > TB_FLAG: return - sum = 0L + sum = 0 for i in range(self.numRows()-1): if str(self.text(i, TB_FLAG)) == "No": continue - sum += long(str(self.text(i, TB_SIZE))) + sum += int(str(self.text(i, TB_SIZE))) self.displaySum(sum) def displaySum(self, sum): @@ -108,7 +110,7 @@ class Table(TQTable): class TableItem(TQTableItem): def __init__(self, *args): - apply(TQTableItem.__init__, (self,) + args) + TQTableItem.__init__(*(self,) + args) def paint(self, p, cg, cr, selected): g = TQColorGroup(cg) |