File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed
Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,25 @@ def _add_section_name(query):
2626 if '/' in query :
2727 return query
2828 if ' ' in query :
29- # for standalone queries only that may contain ' '
30- return "%s/%s" % tuple (query .split (' ' , 1 ))
31- return "%s/%s" % tuple (query .split ('+' , 1 ))
29+ delim = " "
30+ elif '+' in query :
31+ delim = "+"
32+
33+ index = 0
34+ length = len (query )
35+ while index != length :
36+
37+ index = query .index (delim , index ) + 1
38+
39+ try :
40+ comparison = query .index (delim , index )
41+ except ValueError :
42+ comparison = - 1
43+
44+ if (index != comparison and index != length ):
45+ return "%s/%s" % (query [:index - 1 ], query [index :])
46+
47+ return query
3248
3349def cheat_wrapper (query , request_options = None , output_format = 'ansi' ):
3450 """
You can’t perform that action at this time.
0 commit comments