3737 LineStart , LineEnd ,
3838 ZeroOrMore , OneOrMore , Combine , Or , Optional , Suppress , Group ,
3939 nums , alphanums , printables ,
40- stringEnd , pythonStyleComment ,
40+ stringEnd , pythonStyleComment , QuotedString ,
4141 ParseBaseException )
4242except ImportError :
4343 print ('pyparsing is not available' )
5959EMPTYLINE = LineEnd ()
6060COMMENTLINE = pythonStyleComment + EOL
6161INTEGER = Word (nums )
62+ STRING = QuotedString ('"' )
6263REAL = Combine ((INTEGER + Optional ('.' + Optional (INTEGER ))) ^ ('.' + INTEGER ))
6364UDEV_TAG = Word (string .ascii_uppercase , alphanums + '_' )
6465
@@ -76,7 +77,7 @@ def hwdb_grammar():
7677 for category , conn in TYPES .items ())
7778 matchline = Combine (prefix + Word (printables + ' ' + '®' )) + EOL
7879 propertyline = (White (' ' , exact = 1 ).suppress () +
79- Combine (UDEV_TAG - '=' - Word (alphanums + '_=:@*.! ' ) - Optional (pythonStyleComment )) +
80+ Combine (UDEV_TAG - '=' - Word (alphanums + '_=:@*.! " ' ) - Optional (pythonStyleComment )) +
8081 EOL )
8182 propertycomment = White (' ' , exact = 1 ) + pythonStyleComment + EOL
8283
@@ -103,6 +104,8 @@ def property_grammar():
103104 ('POINTINGSTICK_SENSITIVITY' , INTEGER ),
104105 ('POINTINGSTICK_CONST_ACCEL' , REAL ),
105106 ('ID_INPUT_TOUCHPAD_INTEGRATION' , Or (('internal' , 'external' ))),
107+ ('XKB_FIXED_LAYOUT' , STRING ),
108+ ('XKB_FIXED_VARIANT' , STRING )
106109 )
107110 fixed_props = [Literal (name )('NAME' ) - Suppress ('=' ) - val ('VALUE' )
108111 for name , val in props ]
0 commit comments