# Path: acpype/cli.py
# def _chk_py_ver():
# def _handle_exception(level):
# def init_main(binaries: Dict[str, str] = binaries, argv: Optional[List[str]] = None):


import os
import random
import string
import sys
import time
import traceback
from shutil import rmtree
from ccpnmr.format.converters import Mol2Format  # type: ignore
from ccpnmr.format.converters import PdbFormat  # type: ignore
from acpype.cli import ACTopol, elapsedTime, header
                )

                if not molecule.acExe:
                    molecule.printError("no 'antechamber' executable... aborting!")
                    hint1 = "HINT1: is 'AMBERHOME' environment variable set?"
                    hint2 = (
                        "HINT2: is 'antechamber' in your $PATH?"
                        + "    What 'which antechamber' in your terminal says?"
                        + "    'alias' doesn't work for ACPYPE."
                    )
                    molecule.printMess(hint1)
                    molecule.printMess(hint2)
                    sys.exit(1)

                molecule.createACTopol()
                molecule.createMolTopol()
                acpypeFailed = False
            except Exception:
                raise
                _exceptionType, exceptionValue, exceptionTraceback = sys.exc_info()
                print("ACPYPE FAILED: %s" % exceptionValue)
                if debug:
                    traceback.print_tb(exceptionTraceback, file=sys.stdout)
                acpypeFailed = True

            execTime = int(round(time.time() - t0))

            if execTime == 0:
                msg = "less than a second"
            else:

# Path: acpype/cli.py
# def _chk_py_ver():
# def _handle_exception(level):
# def init_main(binaries: Dict[str, str] = binaries, argv: Optional[List[str]] = None):


# Path: legacy/CcpnToAcpype.py
import os
import random
import string
import sys
import time
import traceback
from shutil import rmtree
from ccpnmr.format.converters import Mol2Format  # type: ignore
from ccpnmr.format.converters import PdbFormat  # type: ignore
from acpype.cli import ACTopol, elapsedTime, header

                )

                if not molecule.acExe:
                    molecule.printError("no 'antechamber' executable... aborting!")
                    hint1 = "HINT1: is 'AMBERHOME' environment variable set?"
                    hint2 = (
                        "HINT2: is 'antechamber' in your $PATH?"
                        + "    What 'which antechamber' in your terminal says?"
                        + "    'alias' doesn't work for ACPYPE."
                    )
                    molecule.printMess(hint1)
                    molecule.printMess(hint2)
                    sys.exit(1)

                molecule.createACTopol()
                molecule.createMolTopol()
                acpypeFailed = False
            except Exception:
                raise
                _exceptionType, exceptionValue, exceptionTraceback = sys.exc_info()
                print("ACPYPE FAILED: %s" % exceptionValue)
                if debug:
                    traceback.print_tb(exceptionTraceback, file=sys.stdout)
                acpypeFailed = True

            execTime = int(round(time.time() - t0))

            if execTime == 0:
                msg = "less than a second"
            else:

                msg = elapsedTime(execTime)