Description: Changes that had previously been applied directly to source
Author: David William Richmond Jones <dwrj87@gmail.com>


--- uligo-0.3.orig/board1.py
+++ uligo-0.3/board1.py
@@ -24,7 +24,7 @@
 
 
 from Tkinter import *
-from whrandom import randint
+from random import randint
 import math
 import sys
 import os
@@ -236,8 +236,8 @@ class Board(abstractBoard, Canvas):
 
         if PILinstalled:
             try:
-                self.blackStone = Image.open(os.path.join(gifpath, 'black.gif'))
-                self.whiteStone = Image.open(os.path.join(gifpath, 'white.gif'))
+                self.blackStone = Image.open(os.path.join(gifpath, 'black.gif')).convert('RGBA')
+                self.whiteStone = Image.open(os.path.join(gifpath, 'white.gif')).convert('RGBA')
             except IOError:
                 PILinstalled = 0
 
--- /dev/null
+++ uligo-0.3/uligo.def
@@ -0,0 +1,3 @@
+uligo03
+s /home/piman/projects/debian/uligo/new/uligo-0.3/sgf
+f easy.sgf
--- uligo-0.3.orig/uligo.py
+++ uligo-0.3/uligo.py
@@ -30,7 +30,7 @@ import tkFileDialog
 import tkFont
 import time
 import pickle
-from whrandom import randint
+from random import randint
 import os
 import sys
 from string import split
@@ -204,7 +204,7 @@ class PbmRecord:
         try:
             f = open(os.path.join(self.path,self.filename))
             s = f.readline();
-            if s != 'uligo03\n':            # this is a .dat file from uligo 0.1 or 0.2
+            if s == 'uligo01\n':            # this is a .dat file from uligo 0.1 or 0.2
                 f.seek(0)
                 self.noOfPbms, self.pbmsAsked, self.noRight, self.noWrong, self.list = pickle.load(f)
                 f.close()
@@ -921,14 +921,15 @@ class App:
         """ Save statistics and name of current database and exit the program. """
         if self.pbmRec: self.pbmRec.saveToDisk()
 
+        filename = os.path.join(self.optionspath, 'uligo.def')
         try:
-            f = open(os.path.join(self.optionspath,'uligo.def'),'w')
+            f = open(os.path.join(filename),'w')
             f.write('uligo03\n')
             f.write('s '+self.sgfpath+'\n')
             if self.currentFile: f.write('f '+self.currentFile +'\n')
             f.close()
         except IOError:
-            showwarning('IOError', 'Could not write uligo.def')
+            showwarning('IOError', 'Could not write %s' % filename)
 
         self.saveOptions()
         self.frame.quit()
@@ -1475,30 +1476,32 @@ class App:
 
     def helpLicense(self):
         """ Display the GNU General Public License. """
-        try:
-            t = 'uliGo was written by Ulrich Goertz (u@g0ertz.de).\n' 
-            t = t + 'It is published under the GNU General Public License (see below). ' 
-            t = t + 'In particular you may freely distribute it if you do not change the ' 
-            t = t + 'copyright notices and include all the files that belong to uliGo.\n' 
-            t = t + 'This program is distributed WITHOUT ANY WARRANTY!\n\n'
-            t = t + '------------------------------------------------------------------------\n\n'
-            file = open(os.path.join(self.uligopath, 'doc','license.txt'))
+        t = 'uliGo was written by Ulrich Goertz (u@g0ertz.de).\n' 
+        t += 'It is published under the GNU General Public License (see below). ' 
+        t += 'In particular you may freely distribute it if you do not change the ' 
+        t += 'copyright notices and include all the files that belong to uliGo.\n' 
+        t += 'This program is distributed WITHOUT ANY WARRANTY!\n\n'
+        gpldeb = os.path.join('/usr', 'share', 'common-licenses', 'GPL')
+        gpluli = os.path.join(self.uligopath, 'doc', 'license.txt')
+        if os.path.exists(gpldeb): file = open(gpldeb)
+        elif os.path.exists(gpluli): file = open(gpluli)
+        else: file = None
+        if file:
+            t += '------------------------------------------------------------------------\n\n'
             t = t + file.read()
             file.close()
-        except IOError:
-            t = 'uliGo was written by Ulrich Goertz (u@g0ertz.de).\n' 
-            t = t + 'uliGo is published under the GNU General Public License. ' 
-            t = t + 'See the file gpl.txt for more information. ' 
-            t = t + 'The GPL is also available at http://www.gnu.org/copyleft/gpl.html\n'
-            t = t + 'This program is distributed WITHOUT ANY WARRANTY!\n\n'
         self.textWindow(t,'uliGo license')
 
 
     def helpDoc(self):
         """ Display the documentation. """
-        
-        webbrowser.open('file:'+os.path.abspath(os.path.join(sys.path[0], 'doc', 'manual.html')), new=1)
-
+        docdeb = os.path.join('/usr', 'share', 'doc', 'uligo', 'manual.html')
+        doculi = os.path.join(self.uligopath, 'manual.html')
+        if os.path.exists(docdeb): webbrowser.open('file:'+docdeb, new=1)
+        elif os.path.exists(doculi): webbrowser.open('file:'+doculi, new=1)
+        else:
+            showwarning('Manual not found',
+                        "The uliGo manual could not be found at %s or %s. Please check your uliGo installation." % (docdeb, doculi))
 
     def textWindow(self, t, title='', grab=1):
         """ Open a window and display the text in the string t.
@@ -1775,7 +1778,7 @@ class App:
         self.statisticsWindow.withdraw()
         self.statisticsWindow.title('Statistics')
         self.statisticsText = StringVar()
-        Label(self.statisticsWindow, height=10, width=50, justify=LEFT, font = ('Courier', 11),
+        Label(self.statisticsWindow, height=10, width=50, justify=LEFT, font = ('Courier', 12),
                textvariable=self.statisticsText).pack()
         self.statisticsWindow.protocol('WM_DELETE_WINDOW', self.statisticsWindow.withdraw)        
 
