diff options
author | Walter 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) |
commit | fb8e121ece1b26fe8b9ed614a5a18df1898f5a88 (patch) | |
tree | bf8835ed33e2a770239d05d06890329222d3aa7d | |
parent | 4cf2f1fa52573d7012bcfbdb849f1d0e9929f033 (diff) |
detect machine architecture in order to execute proper binary
-rwxr-xr-x | bin/i686/gnuchess | bin | 0 -> 180672 bytes | |||
-rw-r--r-- | chess.py | 9 |
2 files changed, 8 insertions, 1 deletions
diff --git a/bin/i686/gnuchess b/bin/i686/gnuchess Binary files differnew file mode 100755 index 0000000..f8a2870 --- /dev/null +++ b/bin/i686/gnuchess @@ -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) |