mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 02:53:38 +02:00
Workaround bug in optparse that causes it to not handle unicode group names
This commit is contained in:
parent
00eca123da
commit
691783ef37
1 changed files with 5 additions and 1 deletions
|
|
@ -8,7 +8,7 @@
|
|||
'''
|
||||
import os, cPickle, base64, datetime, json, plistlib
|
||||
from copy import deepcopy
|
||||
from optparse import OptionParser as _OptionParser
|
||||
from optparse import OptionParser as _OptionParser, OptionGroup
|
||||
from optparse import IndentedHelpFormatter
|
||||
|
||||
from calibre.constants import (config_dir, CONFIG_DIR_MODE, __appname__,
|
||||
|
|
@ -159,6 +159,10 @@ def merge_options(self, lower, upper):
|
|||
upper.__dict__[dest] == opt.default:
|
||||
upper.__dict__[dest] = lower.__dict__[dest]
|
||||
|
||||
def add_option_group(self, *args, **kwargs):
|
||||
if isinstance(args[0], type(u'')):
|
||||
args = [OptionGroup(self, *args, **kwargs)] + list(args[1:])
|
||||
return _OptionParser.add_option_group(self, *args, **kwargs)
|
||||
|
||||
class DynamicConfig(dict):
|
||||
'''
|
||||
|
|
|
|||
Loading…
Reference in a new issue