本文整理汇总了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)
示例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)
示例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)