mirror of
https://github.com/moparisthebest/uinput-mapper
synced 2024-11-25 08:52:15 -05:00
Fix optparse code.
Small difference from argparse. ;-)
This commit is contained in:
parent
4323e92a13
commit
c3e35b9260
@ -23,7 +23,7 @@ parser.add_option('-c', '--config', type=str, action='append',
|
|||||||
parser.add_option('-C', '--compat', action='store_true',
|
parser.add_option('-C', '--compat', action='store_true',
|
||||||
help='Enable compatibility mode; for Python < 2.7')
|
help='Enable compatibility mode; for Python < 2.7')
|
||||||
|
|
||||||
args = parser.parse_args()
|
args, _ = parser.parse_args()
|
||||||
|
|
||||||
# Unpickle from stdin ; currently this is the default and only way
|
# Unpickle from stdin ; currently this is the default and only way
|
||||||
f = pickle.Unpickler(sys.stdin)
|
f = pickle.Unpickler(sys.stdin)
|
||||||
@ -31,9 +31,8 @@ f = pickle.Unpickler(sys.stdin)
|
|||||||
conf = f.load()
|
conf = f.load()
|
||||||
|
|
||||||
for path in args.config:
|
for path in args.config:
|
||||||
if path:
|
config = imp.load_source('', path).config
|
||||||
config = imp.load_source('', path).config
|
conf.update(config)
|
||||||
conf.update(config)
|
|
||||||
|
|
||||||
m = KeyMapper(conf)
|
m = KeyMapper(conf)
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ parser.add_option('-i', '--input-file', action='append',
|
|||||||
parser.add_option('-C', '--compat', action='store_true',
|
parser.add_option('-C', '--compat', action='store_true',
|
||||||
help='Enable compatibility mode; for Python < 2.7')
|
help='Enable compatibility mode; for Python < 2.7')
|
||||||
|
|
||||||
args = parser.parse_args()
|
args, _ = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
if len(args.input_file) == 0:
|
if len(args.input_file) == 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user