当前位置: 首页>>代码示例>>Python>>正文


Python Shell.fgrep方法代码示例

本文整理汇总了Python中cloudmesh_base.Shell.Shell.fgrep方法的典型用法代码示例。如果您正苦于以下问题:Python Shell.fgrep方法的具体用法?Python Shell.fgrep怎么用?Python Shell.fgrep使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cloudmesh_base.Shell.Shell的用法示例。


在下文中一共展示了Shell.fgrep方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_012_yaml_load

# 需要导入模块: from cloudmesh_base.Shell import Shell [as 别名]
# 或者: from cloudmesh_base.Shell.Shell import fgrep [as 别名]
    def test_012_yaml_load(self):
        """
        tests adding jobs from a YAML file
        :return:
        """
        HEADING()
        db = self.db
        db.connect()

        # Clear all jobs currently in the database to ensure a correct final assertion
        db.clear()

        # Add the jobs outlined in the YAML file
        db.add_from_yaml("etc/jobs.yaml")

        count_fgrep = len(Shell.fgrep("input:", "etc/jobs.yaml").split("\n"))

        # Assert that the correct number jobs have been added
        assert(db.count() == count_fgrep)
开发者ID:rajpushkar83,项目名称:pbs,代码行数:21,代码来源:test_jobdb.py

示例2: test_013_find_files

# 需要导入模块: from cloudmesh_base.Shell import Shell [as 别名]
# 或者: from cloudmesh_base.Shell.Shell import fgrep [as 别名]
    def test_013_find_files(self):
        """
        tests searching for a file
            the file being searched for exists in 3 files: twice as input and twice as output
        :return:
        """
        HEADING()
        db = self.db

        db.connect()

        # Clear all jobs currently in the database to ensure a correct final assertion
        db.clear()

        # Add the jobs outlined in the YAML file
        db.add_from_yaml("etc/jobs.yaml")
        inputs, outputs = db.find_jobs_with_file("in1.txt")

        # Assert that the lengths of the inputs and outputs arrays are correct
        count_fgrep = len(Shell.fgrep("in1.txt", "etc/jobs.yaml").strip().split("\n"))
        assert(len(inputs) == count_fgrep)
开发者ID:rajpushkar83,项目名称:pbs,代码行数:23,代码来源:test_jobdb.py

示例3: ps

# 需要导入模块: from cloudmesh_base.Shell import Shell [as 别名]
# 或者: from cloudmesh_base.Shell.Shell import fgrep [as 别名]
 def ps(self):
     r = Shell.fgrep(Shell.ps("aux", _tty_out=False), "mongod", _tty_in=False)
     print(r)
开发者ID:kwtillma,项目名称:pbs,代码行数:5,代码来源:cm_jobdb.py


注:本文中的cloudmesh_base.Shell.Shell.fgrep方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。