Coverage for jbank/management/commands/xmlsec1_examples.py: 0%

1 import os

2 import subprocess

3 from django.core.management.base import CommandParser

4 from jutil.command import SafeCommand

5 import jbank

6

7

8 class Command(SafeCommand):

9 help = "Compiles xmlsec1-examples"

10

11 def add_arguments(self, parser: CommandParser):

12 parser.add_argument("--clean", action="store_true")

13 parser.add_argument("--clean-only", action="store_true")

14

15 def do(self, *args, **options):

16 package_path = os.path.dirname(jbank.__file__)

17 xmlsec1_examples_path = os.path.join(package_path, "xmlsec1-examples")

18 print("xmlsec1-examples @ {}".format(xmlsec1_examples_path))

19 os.chdir(xmlsec1_examples_path)

20 if options["clean"] or options["clean_only"]:

21 subprocess.run(["make", "clean"], check=True)

22 if not options["clean_only"]:

23 subprocess.run(["make"], check=True)