> Bug 414755 reports a problem with the inline description editing widget
> not working properly in Opera. This branch disables the editor widget
> for Opera (for now) because the fix could be quite involved.
Could you perhaps update the bug with some thoughts about how you'd go about
fixing this in the future? I have but don't use Opera, but it's still a
bummer to have to disable this.
> = Launchpad lint =
>
> Checking for conflicts. and issues in doctests and templates.
> Running jslint, xmllint, pyflakes, and pylint.
> Using normal rules.
>
> Linting changed files:
> lib/canonical/widgets/lazrjs.py
>
>
> == Pylint notices ==
>
> lib/canonical/widgets/lazrjs.py
> 352: [W0102, vocabulary_to_choice_edit_items] Dangerous default
> value [] as argument
This isn't your code, but here's a suggested change in case you want to clean this up while you're here.
def vocabulary_to_choice_edit_items(
- vocab, css_class_prefix=None, disabled_items=[], as_json=False,
+ vocab, css_class_prefix=None, disabled_items=None, as_json=False,
name_fn=None, value_fn=None):
"""Convert an enumerable to JSON for a ChoiceEdit.
@@ -359,6 +359,8 @@
:name_fn: A function receiving an item and returning its name.
:value_fn: A function receiving an item and returning its value.
"""
+ if disabled_items is None:
+ disabled_items = []
items = []
for item in vocab:
if name_fn is not None:
> Bug 414755 reports a problem with the inline description editing widget
> not working properly in Opera. This branch disables the editor widget
> for Opera (for now) because the fix could be quite involved.
Could you perhaps update the bug with some thoughts about how you'd go about
fixing this in the future? I have but don't use Opera, but it's still a
bummer to have to disable this.
> = Launchpad lint = widgets/ lazrjs. py widgets/ lazrjs. py to_choice_ edit_items] Dangerous default
>
> Checking for conflicts. and issues in doctests and templates.
> Running jslint, xmllint, pyflakes, and pylint.
> Using normal rules.
>
> Linting changed files:
> lib/canonical/
>
>
> == Pylint notices ==
>
> lib/canonical/
> 352: [W0102, vocabulary_
> value [] as argument
This isn't your code, but here's a suggested change in case you want to clean this up while you're here.
=== modified file 'lib/canonical/ widgets/ lazrjs. py' widgets/ lazrjs. py 2009-08-10 21:05:33 +0000 widgets/ lazrjs. py 2009-08-21 19:27:50 +0000
--- lib/canonical/
+++ lib/canonical/
@@ -348,7 +348,7 @@
def vocabulary_ to_choice_ edit_items( prefix= None, disabled_items=[], as_json=False, prefix= None, disabled_ items=None, as_json=False,
- vocab, css_class_
+ vocab, css_class_
name_fn=None, value_fn=None):
"""Convert an enumerable to JSON for a ChoiceEdit.
@@ -359,6 +359,8 @@
:name_fn: A function receiving an item and returning its name.
:value_fn: A function receiving an item and returning its value.
"""
+ if disabled_items is None:
+ disabled_items = []
items = []
for item in vocab:
if name_fn is not None: