@@ 1,4 1,5 @@
import shlex
+from typing import List, Dict, Optional
def get(directives, name):
@@ 16,9 17,9 @@ def get_all(directives, name):
class Directive:
- name = None
- params = None
- children = None
+ name: str
+ params: List[str]
+ children: List['Directive']
def __init__(self, name, params, children=None):
self.name = name
@@ 28,10 29,10 @@ class Directive:
def __str__(self):
return f"{self.name}: {self.params}"
- def get(self, name):
+ def get(self, name) -> Optional['Directive']:
return get(self.children, name)
- def get_all(self, name):
+ def get_all(self, name) -> List['Directive']:
return get_all(self.children, name)
@@ 84,8 85,8 @@ class Config:
return blocks, closing_brace
- def get(self, name):
+ def get(self, name) -> Optional[Directive]:
return get(self.directives, name)
- def get_all(self, name):
+ def get_all(self, name) -> List[Directive]:
return get_all(self.directives, name)
@@ 9,11 9,11 @@ else:
"See https://hg.code.netlandish.com/~petersanchez/py-scfg"
)
-
setup(
name="py-scfg",
version="0.1.1",
packages=find_packages(),
+ package_data={"scfg": ["py.typed"]},
description="Module to read scfg formatted configuration files.",
author="Peter Sanchez",
author_email="pjs@petersanchez.com",
@@ 30,5 30,4 @@ setup(
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
- include_package_data=True,
)