File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 1
1
* .pyc
2
+ * .pyo
2
3
* ~
3
4
4
5
# Emacs
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ class JsonPathLexer(object):
13
13
14
14
def __init__ (self , debug = False ):
15
15
self .debug = debug
16
+ if self .__doc__ == None :
17
+ raise Exception ('Docstrings have been removed! By design of PLY, jsonpath-rw requires docstrings. You must not use PYTHONOPTIMIZE=2 or python -OO.' )
16
18
17
19
def tokenize (self , string ):
18
20
'''
Original file line number Diff line number Diff line change @@ -14,9 +14,16 @@ def parse(string):
14
14
return JsonPathParser ().parse (string )
15
15
16
16
class JsonPathParser (object ):
17
+ '''
18
+ An LALR-parser for JsonPath
19
+ '''
20
+
17
21
tokens = JsonPathLexer .tokens
18
22
19
23
def __init__ (self , debug = False , lexer_class = None ):
24
+ if self .__doc__ == None :
25
+ raise Exception ('Docstrings have been removed! By design of PLY, jsonpath-rw requires docstrings. You must not use PYTHONOPTIMIZE=2 or python -OO.' )
26
+
20
27
self .debug = debug
21
28
self .lexer_class = lexer_class or JsonPathLexer # Crufty but works around statefulness in PLY
22
29
You can’t perform that action at this time.
0 commit comments