Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2012-07-30 18:15:54 (GMT)
committer Walter Bender <walter.bender@gmail.com>2012-07-30 18:15:54 (GMT)
commitfb8e121ece1b26fe8b9ed614a5a18df1898f5a88 (patch)
treebf8835ed33e2a770239d05d06890329222d3aa7d
parent4cf2f1fa52573d7012bcfbdb849f1d0e9929f033 (diff)
detect machine architecture in order to execute proper binary
-rwxr-xr-xbin/i686/gnuchessbin0 -> 180672 bytes
-rw-r--r--chess.py9
2 files changed, 8 insertions, 1 deletions
diff --git a/bin/i686/gnuchess b/bin/i686/gnuchess
new file mode 100755
index 0000000..f8a2870
--- /dev/null
+++ b/bin/i686/gnuchess
Binary files differ
diff --git a/chess.py b/chess.py
index ab20455..81b88fc 100644
--- a/chess.py
+++ b/chess.py
@@ -62,6 +62,7 @@ class Gnuchess():
colors=['#A0FFA0', '#FF8080']):
self._activity = parent
self._bundle_path = path
+ self._bin_path = 'bin/i686'
self._colors = ['#FFFFFF']
self._colors.append(colors[0])
self._colors.append(colors[1])
@@ -112,11 +113,17 @@ class Gnuchess():
self._sprites = Sprites(self._canvas)
self._generate_sprites(colors)
+ p = subprocess.Popen(['uname', '-p'],
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT)
+ self._bin_path = 'bin/%s' % (p.communicate()[0].replace('\n', ''))
self._all_clear()
def move(self, my_move):
''' Send a command to gnuchess. '''
- p = subprocess.Popen(['%s/bin/gnuchess' % (self._bundle_path)],
+ p = subprocess.Popen(['%s/%s/gnuchess' % (self._bundle_path,
+ self._bin_path)],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)