Kind: Class
Source: atloria-monorepo/libs/parser-core/src/parsers/backend/python.parser.ts
Python Project Parser implementation
Implements: IParser
Methods
| Method | Signature | Returns |
|---|---|---|
initialize | initialize(_config: ParserConfig) | Promise<void> |
canParse | canParse(filePath: string) | boolean |
parseFile | parseFile(filePath: string, content: string) | Promise<ParseResult> |
parseFiles | parseFiles(files: ParseFileInput[]) | Promise<ParseResult[]> |
destroy | destroy() | Promise<void> |
Properties
| Property | Type |
|---|---|
name | any |
version | any |
supportedPatterns | any |
Where it refuses work
PythonParserstops the work with an early return when/\.python-version$/.test(filePath) || /runtime\.txt$/.test(filePath).PythonParserstops the work with an early return when!match.PythonParserstops the work with an early return whenversionSpec === '*' || versionSpec === ''.PythonParserstops the work with an early return when/^[0-9.]+$/.test(versionSpec).PythonParserstops the work with an early return when/^[><=!]/.test(versionSpec).
When something fails
PythonParserhandles failure in 3 places: it turns it into a return value in all 3.
Was this page helpful?