Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/prison/constants.py: 100%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

8 statements  

1import re 

2 

3 

4WHITESPACE = '' 

5 

6IDCHAR_PUNCTUATION = '_-./~%+' 

7 

8NOT_IDCHAR = ''.join([c for c in (chr(i) for i in range(127)) 

9 if not (c.isalnum() 

10 or c in IDCHAR_PUNCTUATION)]) 

11 

12# Additionally, we need to distinguish ids and numbers by first char. 

13NOT_IDSTART = '-0123456789' 

14 

15# Regexp string matching a valid id. 

16IDRX = ('[^' + NOT_IDSTART + NOT_IDCHAR + '][^' + NOT_IDCHAR + ']*') 

17 

18# Regexp to check for valid rison ids. 

19ID_OK_RE = re.compile('^' + IDRX + '$', re.M) 

20 

21# Regexp to find the end of an id when parsing. 

22NEXT_ID_RE = re.compile(IDRX, re.M)