示例#1
0
文件: make.py 项目: veltzer/pydmt
 def setup(self, pydmt: PyDMT) -> None:
     if os.path.isfile("Makefile"):
         pydmt.add_builder(
             BuilderMake(
                 source="Makefile",
                 target="out/make.stamp",
             ))
示例#2
0
 def setup(self, pydmt: PyDMT) -> None:
     if not os.path.isfile(SOURCE_FILE):
         return
     builder = BuilderReqs(
         source=SOURCE_FILE,
         target=TARGET_FILE,
     )
     pydmt.add_builder(builder)
示例#3
0
 def test06Fail(self):
     with tempdir():
         shutil.copy("/etc/passwd", "passwd")
         p = PyDMT()
         b = Fail("passwd", "copy_of_passwd")
         p.add_builder(b)
         stats = p.build_all()
         self.assertEqual(stats.get_builder_ok(), 0)
         self.assertEqual(stats.get_builder_fail(), 1)
         self.assertEqual(stats.get_copy_missing(), 0)
         self.assertEqual(stats.get_nop(), 0)
示例#4
0
文件: main.py 项目: veltzer/pydmt
def build():
    add_to_path()

    pylogconf.core.setup()
    p = PyDMT()

    logger = logging.getLogger(LOGGER_NAME)
    logger.setLevel(ConfigLogging.loglevel)

    add_all_features(p)

    stats = p.build_all()
    sys.exit(stats.get_os_error_code())
示例#5
0
文件: main.py 项目: veltzer/pydmt
def clean() -> None:
    add_to_path()

    pylogconf.core.setup()
    p = PyDMT()

    logger = logging.getLogger(LOGGER_NAME)
    logger.setLevel(ConfigLogging.loglevel)

    add_all_features(p)

    shutil.rmtree(".pydmt")
    p.clean_all()
示例#6
0
文件: yaml.py 项目: veltzer/pydmt
 def setup(self, pydmt: PyDMT) -> None:
     if not os.path.isdir(self.yaml_folder):
         return
     for root, _, filenames in os.walk(self.yaml_folder):
         for filename in filenames:
             source = os.path.join(root, filename)
             target_base, ext = os.path.splitext(source)
             if ext == ".yaml":
                 target = os.sep.join([self.validation_folder, target_base, source + ".stamp"])
                 builder = BuilderYaml(
                     source=source,
                     target=target,
                 )
                 pydmt.add_builder(builder)
示例#7
0
文件: mako.py 项目: veltzer/pydmt
 def setup(self, pydmt: PyDMT) -> None:
     if not os.path.isdir(self.templates_folder):
         return
     for root, _, filenames in os.walk(self.templates_folder):
         for filename in filenames:
             source = os.path.join(root, filename)
             target_base, ext = os.path.splitext(source)
             if ext == '.mako':
                 target = os.sep.join(target_base.split(os.sep)[1:])
                 builder = BuilderMako(
                     source=source,
                     target=target,
                     data=self.data,
                     config_files=files_under_folder(self.config_folder,
                                                     suffix=".py"),
                     snipplet_files=files_under_folder(self.snipplet_folder,
                                                       suffix=".mako"),
                 )
                 pydmt.add_builder(builder)
示例#8
0
 def test05CopyAfterRemove(self):
     with tempdir():
         shutil.copy("/etc/passwd", "passwd")
         p = PyDMT()
         b = Copy("passwd", "copy_of_passwd")
         p.add_builder(b)
         p.build_all()
         os.unlink("copy_of_passwd")
         stats = p.build_all()
         self.assertEqual(stats.get_builder_ok(), 0)
         self.assertEqual(stats.get_builder_fail(), 0)
         self.assertEqual(stats.get_nop(), 0)
         self.assertEqual(stats.get_copy_missing(), 1)
示例#9
0
 def setup(self, pydmt: PyDMT) -> None:
     if not os.path.isdir(SPHINX_FOLDER):
         return
     pydmt.add_builder(BuilderSphinx())
示例#10
0
 def get_std_test():
     shutil.copy("/etc/passwd", "passwd")
     p = PyDMT()
     b = Copy("passwd", "copy_of_passwd")
     p.add_builder(b)
     return p.build_all()
示例#11
0
 def test02ReturnType(self):
     p = PyDMT()
     stats = p.build_all()
     self.assertIsInstance(stats, BuildProcessStats, "must be BuildProcessStats")
示例#12
0
 def test01NullBuild(self):
     p = PyDMT()
     p.build_all()
示例#13
0
 def setup(self, pydmt: PyDMT) -> None:
     if os.path.isfile("config/python.py"):
         pydmt.add_builder(BuilderVenv(
             source="config/python.py",
             target="out/python.stamp",
         ))
示例#14
0
文件: apt.py 项目: veltzer/pydmt
 def setup(self, pydmt: PyDMT) -> None:
     if self.packages is not None:
         pydmt.add_builder(
             BuilderApt(source="config/deps.py",
                        target="out/deps.stamp",
                        packages=self.packages))
示例#15
0
 def test00CreatePyDMT(self):
     PyDMT()
示例#16
0
 def setup(self, pydmt: PyDMT) -> None:
     if not os.path.isfile("config/python.py"):
         return
     pydmt.add_builder(BuilderVenvFull())
示例#17
0
文件: npm.py 项目: veltzer/pydmt
 def setup(self, pydmt: PyDMT) -> None:
     if os.path.isfile("package.json"):
         pydmt.add_builder(Installer(
             source="package.json",
             target="out/npm.stamp",
         ))