From 0d64a8fa5383f48b2acbe40b8af9e0c4760e7163 Mon Sep 17 00:00:00 2001 From: Skyler Lehmkuhl Date: Sun, 8 Jan 2012 13:34:46 -0500 Subject: [PATCH] Added platform checking --- svlgui.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/svlgui.py b/svlgui.py index 0839e1b..ab52c86 100644 --- a/svlgui.py +++ b/svlgui.py @@ -5,6 +5,7 @@ import sys import math import random import colors +import platform ''' # Tool mode. Keyboard shortcut is the same key. Modes are: @@ -107,7 +108,17 @@ FILLCOLOR = Color("#000000") #Magic. Detect platform and select appropriate toolkit. To be used throughout code. if sys.platform=="linux2": - PLATFORM="linux32" + id = platform.machine() + if id.startswith('arm'): + PLATFORM = 'linuxARM' + elif (not id) or (not re.match('(x|i[3-6])86$', id) is None): + PLATFORM = 'linux32' + elif id == 'x86_64': + PLATFORM = 'linux64' + elif "ppc" in plid.lower(): + PLATFORM = "linuxPPC" + else: + PLATFORM = "error" import gtk import cairo import gobject