From a66f6d2ba6312c0a29bfbc3ac3fd8c859b42a500 Mon Sep 17 00:00:00 2001 From: punkrockguy318 Date: Mon, 11 Aug 2008 04:26:37 +0000 Subject: [PATCH] fceux now writes config direcoty as soon as it starts whether a rom is loaded or not [[Split portion of a mixed commit.]] --- config_parse.py | 16 +++++----------- gfceux | 9 +++------ mockup_test.py | 17 ++++++----------- 3 files changed, 14 insertions(+), 28 deletions(-) diff --git a/config_parse.py b/config_parse.py index 74f3a52d..8c79e108 100755 --- a/config_parse.py +++ b/config_parse.py @@ -39,17 +39,11 @@ class ConfigParser: if re.search(keyname, line): cursor = self.f.tell() break - - self.f.seek(cursor) - while 1: - c = self.f.read(1) -# self.f.seek(5, 1) - print c, - - if c == '=': - self.f.seek(1, os.SEEK_CUR) - #self.f.write(value) - self.f.flush() + + newline = line.split('=')[0] + '=' + str(value) + self.f.seek(os.SEEK_CUR, -line.split('=')[0].__len__) + + diff --git a/gfceux b/gfceux index a40b939d..4b771152 100755 --- a/gfceux +++ b/gfceux @@ -162,7 +162,6 @@ def set_options(): options.autoscale_check = widgets.get_object("autoscale_check").get_active() options.xscale_spin = widgets.get_object("xscale_spin").get_value() - print options.xscale_spin options.yscale_spin = widgets.get_object("yscale_spin").get_value() options.extra_entry = widgets.get_object("extra_entry").get_text() @@ -256,10 +255,8 @@ class GfceuApp: def find_fceu(self): bin = find_binary('fceux') if bin == None: - gfceu_error('Could not find the fceu binary.\n\ - Ensure that FCE Ultra is installed and in the $PATH.\n\ - On Debian based systems (like Ubuntu), try the following command:\n\ - sudo apt-get install fceu', 4, True) + gfceu_error('Could not find the fceux binary.\n\ + Ensure that fceux is installed and in the $PATH.\n', 4, True) else: self.msg('Using: ' + bin) @@ -276,7 +273,7 @@ class GfceuApp: glade_file = os.path.join(os.path.dirname(sys.argv[0]), '../share/gfceux/gfceux.xml') else: print 'ERROR.' - print 'Could not find the glade.xml file.' + print 'Could not find the ' + glade_file + ' file.' print 'Try reinstalling the application.' sys.exit(1) diff --git a/mockup_test.py b/mockup_test.py index 3eb75e94..c29b0bb7 100644 --- a/mockup_test.py +++ b/mockup_test.py @@ -1,17 +1,12 @@ #!/usr/bin/env python # displays mockup of gamepad config -import gtk, gtk.glade +import gtk -class WidgetsWrapper: - def __init__(self): - self.widgets = gtk.glade.XML ('gfceu.glade', "gamepad_config_window") - self.widgets.signal_autoconnect(GladeHandlers.__dict__) - # Gives us the ability to do: widgets['widget_name'].action() - def __getitem__(self, key): - return self.widgets.get_widget(key) +glade_file = 'gfceux.xml' +print "Using: " + glade_file +widgets = gtk.Builder() +widgets.add_from_file(glade_file) -widgets = WidgetsWrapper() - -widgets['gamepad_config_window'].show_all() +widgets.get_object('gamepad_config_window').show_all() gtk.main ()