changeset 551:fc43840cc6b0

updated version check to min of 1.8.0
author davidbyron
date Tue, 30 Mar 2010 20:11:35 -0500
parents ebbc4fec8c4f
children f86fa363ec0d
files plugins/xxinit2.py
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/xxinit2.py	Tue Mar 30 06:08:39 2010 -0600
+++ b/plugins/xxinit2.py	Tue Mar 30 20:11:35 2010 -0500
@@ -20,7 +20,7 @@
 
 from string import find, replace
 import wx
-
+import re
 import os
 import orpg.dirpath
 import orpg.orpg_version
@@ -29,7 +29,7 @@
 import hashlib
 import random
 
-__version__ = "2.2.8"
+__version__ = "2.2.9"
 
 class v:
     init_list = []
@@ -48,7 +48,6 @@
         self.help += "the readme, and double-click Commands & Help if you want to see examples."
 
         self.version = __version__
-        self.orpg_min_version="1.7.0"
 
 
     def plugin_enabled(self):
@@ -2063,8 +2062,16 @@
     ###############################################################
 
     def check_version(self):
-       if(int(replace(orpg.orpg_version.VERSION, ".", "")) < int(replace(self.orpg_min_version, ".", ""))):
-          self.post_sysmsg("<br><font color='#ff0000'>WARNING</font>: You are currently using OpenRPG " + str(orpg.orpg_version.VERSION) + " but you need OpenRPG " + str(self.orpg_min_version) + " or greater to run the Initiative Tool " + str(self.version) + "<br>Use it at your own risk!</b><br>")
+        warn = False
+        try:
+            numeric_only = re.compile(r'[^\d.]+')
+            numeric_version = numeric_only.sub('', orpg.orpg_version.VERSION)
+            if(int(numeric_version) < 180):
+               warn = True
+        except:
+            warn = True
+        if warn:
+            self.post_sysmsg("<br><font color='#ff0000'>WARNING</font>: You are currently using OpenRPG " + str(orpg.orpg_version.VERSION) + " but you need OpenRPG 1.8.0 or greater to run the Initiative Tool " + str(self.version) + "<br>Use it at your own risk!</b><br>")
 
     def isD20(self):
         if self.init_system == "D20":