251 |
251 |
252 @return tuple containing the line number and the coding |
252 @return tuple containing the line number and the coding |
253 @rtype tuple of int and str |
253 @rtype tuple of int and str |
254 """ |
254 """ |
255 for lineno, line in enumerate(self.__source[:5]): |
255 for lineno, line in enumerate(self.__source[:5]): |
256 matched = re.search('coding[:=]\s*([-\w_.]+)', line, re.IGNORECASE) |
256 matched = re.search(r'coding[:=]\s*([-\w_.]+)', |
|
257 line, re.IGNORECASE) |
257 if matched: |
258 if matched: |
258 return lineno, matched.group(1) |
259 return lineno, matched.group(1) |
259 else: |
260 else: |
260 return 0, "" |
261 return 0, "" |
261 |
262 |