mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 17:23:36 +02:00
App.__aexit__(): Use to close exec context
Override lib.App.__aexit() to call close() on the App.exec_context instance if it exists. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
3d27cc09d9
commit
60630676ef
1 changed files with 6 additions and 0 deletions
|
|
@ -236,6 +236,12 @@ class App(Base):
|
||||||
self.__projs_root = pwd.getpwuid(os.getuid()).pw_dir + "/local/src/jw.dev/proj"
|
self.__projs_root = pwd.getpwuid(os.getuid()).pw_dir + "/local/src/jw.dev/proj"
|
||||||
self.__pretty_projs_root = None
|
self.__pretty_projs_root = None
|
||||||
|
|
||||||
|
async def __aexit__(self, exc_type, exc, tb) -> None:
|
||||||
|
if self.__exec_context is not None:
|
||||||
|
await self.__exec_context.close()
|
||||||
|
self.__exec_context = None
|
||||||
|
return super().__aexit__(exc_type, exc, tb)
|
||||||
|
|
||||||
def _add_arguments(self, parser) -> None:
|
def _add_arguments(self, parser) -> None:
|
||||||
super()._add_arguments(parser)
|
super()._add_arguments(parser)
|
||||||
parser.add_argument('-t', '--topdir', default = None, help='Project Path')
|
parser.add_argument('-t', '--topdir', default = None, help='Project Path')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue