Share

DRI Configuration Applet

Tracker: Bugs

5 driconf-0.9.1 uninitialized variable - ID: 1656905
Last Update: Comment added ( fxkuehl )

An uninitialized variable in a driconf-0.9.1 file causes python to
complain.

I start driconf from a terminal without a pre-existing ~/.drirc
configuration file.

I open the "Application settings" dropdown at the bottom of the page.

I select "Add", and put in doom3-demo and doom.x86 in the dialog fields,
and select "OK".

At this point driconf spews forth it's displeasure upon stderr:

Code:
Traceback (most recent call last):
File "/usr/lib/driconf/driconf_simpleui.py", line 692, in changeApp
self.selectApp(app)
File "/usr/lib/driconf/driconf_simpleui.py", line 641, in selectApp
self.appPage = AppPage (self.driver, app)
File "/usr/lib/driconf/driconf_simpleui.py", line 347, in __init__
self.refreshOptions()
File "/usr/lib/driconf/driconf_simpleui.py", line 369, in refreshOptions
self.optionTree.append(sectIter, [
File "/usr/lib/driconf/driconf_simpleui.py", line 271, in lineWrap
head, tail = head + tail[:i] + '\n', tail[j:]
UnboundLocalError: local variable 'j' referenced before assignment

It must be a python interpreter change. It seems like variables must be
initialized before being used...

To fix it, add "j = i" at line 260 in /usr/lib/driconf/driconf_simpleui.py,
after the existing line "i = chars"


James C. Georgas ( jgeorgas ) - 2007-02-10 19:23

5

Open

None

Felix Kuehling

None

None

Public


Comment ( 1 )

Date: 2007-02-18 17:17
Sender: fxkuehlProject Admin


Thanks for catching this problem. Your solution would work, but I still
found it difficult to wrap my head around the logic of this function, even
though I wrote it. ;-) Can you try the patch below, making the whole thing
a bit more robust? I'll apply that if it works for you.

--- driconf_simpleui.py (Revision 284)
+++ driconf_simpleui.py (Arbeitskopie)
@@ -266,8 +266,8 @@
j = i
break
i = i - 1
- if i < chars/3:
- i = chars
+ else:
+ i = j = chars
head, tail = head + tail[:i] + '\n', tail[j:]
return head




Attached File ( 1 )

Filename Description Download
dri.patch Patch to fix the error described above Download

Changes ( 2 )

Field Old Value Date By
assigned_to nobody 2007-02-18 17:17 fxkuehl
File Added 215348: dri.patch 2007-02-10 19:23 jgeorgas