Skip to content

Commit

Permalink
Catch "Ctrl+C" while configuring PoC. Implemented ToolMixIn for class…
Browse files Browse the repository at this point in the history
… GHDL.
  • Loading branch information
Patrick Lehmann authored and Patrick Lehmann committed Nov 22, 2016
1 parent cf8c6d4 commit c90631f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 32 deletions.
3 changes: 3 additions & 0 deletions py/PoC.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,9 @@ def HandleConfiguration(self, args):
break
except ExceptionBase as ex:
print(" {RED}FAULT:{NOCOLOR} {0}".format(ex.message, **Init.Foreground))
except KeyboardInterrupt:
print("\n\n{RED}Abort configuration.\nNo files have been created or changed.{NOCOLOR}".format(**Init.Foreground))
return

# write and re-read configuration
self.__WritePoCConfiguration()
Expand Down
7 changes: 5 additions & 2 deletions py/ToolChains/GHDL.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from re import compile as re_compile
from subprocess import check_output, CalledProcessError

from lib.Functions import CallByRefParam
from Base.Configuration import Configuration as BaseConfiguration, ConfigurationException
from Base.Exceptions import PlatformNotSupportedException
from Base.Executable import Executable, LongValuedFlagArgument
Expand All @@ -46,7 +47,7 @@
from Base.Logging import LogEntry, Severity
from Base.Simulator import PoCSimulationResultFilter, SimulationResult
from Base.ToolChain import ToolChainException
from lib.Functions import CallByRefParam
from ToolChains import ToolMixIn


__api__ = [
Expand Down Expand Up @@ -179,8 +180,10 @@ def __WriteGHDLSection(self, binPath):
self._host.PoCConfig[self._section]['Backend'] = backend


class GHDL(Executable):
class GHDL(Executable, ToolMixIn):
def __init__(self, platform, dryrun, binaryDirectoryPath, version, backend, logger=None):
ToolMixIn.__init__(self, platform, dryrun, binaryDirectoryPath, version, logger=logger)

if (platform == "Windows"): executablePath = binaryDirectoryPath / "ghdl.exe"
elif (platform == "Linux"): executablePath = binaryDirectoryPath / "ghdl"
elif (platform == "Darwin"): executablePath = binaryDirectoryPath / "ghdl"
Expand Down
33 changes: 3 additions & 30 deletions py/ToolChains/Git.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,42 +42,15 @@

from Base.Exceptions import PlatformNotSupportedException, CommonException
from Base.Configuration import Configuration as BaseConfiguration, ConfigurationException, SkipConfigurationException
from Base.Executable import Executable, ExecutableArgument, CommandLineArgumentList, CommandArgument, LongFlagArgument, ValuedFlagArgument, StringArgument, \
LongValuedFlagArgument, LongTupleArgument
from Base.Executable import Executable, ExecutableArgument, CommandLineArgumentList
from Base.Executable import CommandArgument, LongFlagArgument, ValuedFlagArgument, StringArgument, LongValuedFlagArgument, LongTupleArgument
from Base.ToolChain import ToolChainException
from ToolChains import ToolMixIn

__api__ = [
'GitException',
'Configuration',
'Git',
'GitSCM',
'GitRevParse',
'GitRevList',
'GitDescribe',
'GitConfig'
]
__all__ = __api__


__api__ = [
'GitException',
'Configuration',
'GitMixIn',
'Git',
'GitSCM',
'GitRevParse',
'GitRevList',
'GitDescribe',
'GitConfig'
]
__all__ = __api__
from ToolChains import ToolMixIn


__api__ = [
'GitException',
'Configuration',
'GitMixIn',
'Git',
'GitSCM',
'GitRevParse',
Expand Down

0 comments on commit c90631f

Please sign in to comment.