Add gitignore.
This commit is contained in:
parent
c6d8ce59c0
commit
2580518234
2 changed files with 67 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@ build
|
||||||
*~
|
*~
|
||||||
ognibuild.egg-info
|
ognibuild.egg-info
|
||||||
dist
|
dist
|
||||||
|
__pycache__
|
||||||
|
|
66
ognibuild/session/__init__.py
Normal file
66
ognibuild/session/__init__.py
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
# Copyright (C) 2020 Jelmer Vernooij <jelmer@jelmer.uk>
|
||||||
|
# encoding: utf-8
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
from typing import Optional, List, Dict
|
||||||
|
|
||||||
|
|
||||||
|
class Session(object):
|
||||||
|
|
||||||
|
def __enter__(self) -> 'Session':
|
||||||
|
return self
|
||||||
|
|
||||||
|
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||||
|
return False
|
||||||
|
|
||||||
|
def chdir(self, cwd: str) -> None:
|
||||||
|
raise NotImplementedError(self.chdir)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def location(self) -> str:
|
||||||
|
raise NotImplementedError(self.location)
|
||||||
|
|
||||||
|
def check_call(
|
||||||
|
self,
|
||||||
|
argv: List[str], cwd: Optional[str] = None,
|
||||||
|
user: Optional[str] = None,
|
||||||
|
env: Optional[Dict[str, str]] = None):
|
||||||
|
raise NotImplementedError(self.check_call)
|
||||||
|
|
||||||
|
def check_output(
|
||||||
|
self,
|
||||||
|
argv: List[str], cwd: Optional[str] = None,
|
||||||
|
user: Optional[str] = None,
|
||||||
|
env: Optional[Dict[str, str]] = None) -> bytes:
|
||||||
|
raise NotImplementedError(self.check_output)
|
||||||
|
|
||||||
|
def Popen(self, argv, cwd: Optional[str] = None,
|
||||||
|
user: Optional[str] = None, **kwargs):
|
||||||
|
raise NotImplementedError(self.Popen)
|
||||||
|
|
||||||
|
def call(
|
||||||
|
self, argv: List[str], cwd: Optional[str] = None,
|
||||||
|
user: Optional[str] = None):
|
||||||
|
raise NotImplementedError(self.call)
|
||||||
|
|
||||||
|
def create_home(self) -> None:
|
||||||
|
"""Create the user's home directory."""
|
||||||
|
raise NotImplementedError(self.create_home)
|
||||||
|
|
||||||
|
|
||||||
|
class SessionSetupFailure(Exception):
|
||||||
|
"""Session failed to be set up."""
|
Loading…
Add table
Add a link
Reference in a new issue