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


Python Process.system方法代码示例

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


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

示例1: setUp

# 需要导入模块: from jarn.mkrelease.process import Process [as 别名]
# 或者: from jarn.mkrelease.process.Process import system [as 别名]
 def setUp(self):
     SubversionSetup.setUp(self)
     process = Process(quiet=True)
     process.system('svn mv -m"Rename" "file://%s/tags" "file://%s/tag"' %
         (self.packagedir, self.packagedir))
     process.system('svn mv -m"Rename" "file://%s/branches" "file://%s/branch"' %
         (self.packagedir, self.packagedir))
开发者ID:SalesSeek,项目名称:jarn.mkrelease,代码行数:9,代码来源:test_subversion.py

示例2: checkout

# 需要导入模块: from jarn.mkrelease.process import Process [as 别名]
# 或者: from jarn.mkrelease.process.Process import system [as 别名]
 def checkout(self, path='trunk', target=None):
     process = Process(quiet=True)
     if target is None:
         self.checkoutdir = join(self.tempdir, self.packagename)
     else:
         self.checkoutdir = join(self.tempdir, target, self.packagename)
     process.system('svn checkout file://%s/%s %s' % (self.repo,
         path, self.checkoutdir))
     os.chdir(self.checkoutdir)
开发者ID:proyvind,项目名称:git-svn-helpers,代码行数:11,代码来源:testing.py

示例3: clone

# 需要导入模块: from jarn.mkrelease.process import Process [as 别名]
# 或者: from jarn.mkrelease.process.Process import system [as 别名]
 def clone(self):
     process = Process(quiet=True)
     process.system('git clone testpackage testclone')
     self.clonedir = join(self.tempdir, 'testclone')
     # Park the server on a branch because "Updating the currently
     # checked-out branch may cause confusion."
     self.dirstack.push('testpackage')
     process.system('git checkout -b parking')
     self.dirstack.pop()
开发者ID:SalesSeek,项目名称:jarn.mkrelease,代码行数:11,代码来源:testing.py

示例4: _fake_clone

# 需要导入模块: from jarn.mkrelease.process import Process [as 别名]
# 或者: from jarn.mkrelease.process.Process import system [as 别名]
 def _fake_clone(self):
     # Fake a checkout, the real thing is too expensive
     process = Process(quiet=True)
     source = self._fake_source
     package = join(dirname(__file__), 'tests', source)
     archive = zipfile.ZipFile(package, 'r')
     archive.extractall()
     os.rename(source[:-4], 'testclone')
     self.dirstack.push('testclone')
     if self.scm.version_info[:2] >= (1, 7):
         url = process.popen('svn info')[1][2][5:]
     else:
         url = process.popen('svn info')[1][1][5:]
     process.system('svn switch --relocate %s file://%s/trunk' % (url, self.packagedir))
     self.dirstack.pop()
     self.clonedir = join(self.tempdir, 'testclone')
开发者ID:SalesSeek,项目名称:jarn.mkrelease,代码行数:18,代码来源:testing.py

示例5: test_env

# 需要导入模块: from jarn.mkrelease.process import Process [as 别名]
# 或者: from jarn.mkrelease.process.Process import system [as 别名]
 def test_env(self):
     env = os.environ.copy()
     env['HELLO'] = 'Hello world'
     process = Process(env=env)
     rc = process.system('echo ${HELLO} > output')
     self.assertEqual(rc, 0)
     self.assertEqual(process.pipe('cat output'), 'Hello world')
开发者ID:Jarn,项目名称:jarn.mkrelease,代码行数:9,代码来源:test_process.py

示例6: testGetGitifySubversion

# 需要导入模块: from jarn.mkrelease.process import Process [as 别名]
# 或者: from jarn.mkrelease.process.Process import system [as 别名]
    def testGetGitifySubversion(self):
        """
        Support git-svn-helpers/gitify style dual git/svn checkouts/clones.
        """
        # Simulate a git-svn-helpers/gitify style dual svn/git checkout/clone
        svn_url = urlparse.urlunsplit(('file', '', self.packagedir, '', ''))
        git_svn_clonedir = self.clonedir + '.git-svn'
        process = Process(quiet=True)
        process.system(
            'git svn clone -s {0} {1}'.format(svn_url, git_svn_clonedir))
        os.rename(
            os.path.join(git_svn_clonedir, '.git'),
            os.path.join(self.clonedir, '.git'))

        scms = SCMFactory()
        self.assertEqual(scms.get_scm_from_url(svn_url).name, 'svn')
        self.assertEqual(scms.get_scm_from_sandbox(self.clonedir).name, 'svn')
开发者ID:sixfeetup,项目名称:jarn.mkrelease,代码行数:19,代码来源:test_scmfactory.py

示例7: testAmbiguousSandbox

# 需要导入模块: from jarn.mkrelease.process import Process [as 别名]
# 或者: from jarn.mkrelease.process.Process import system [as 别名]
 def testAmbiguousSandbox(self):
     scms = SCMFactory()
     process = Process()
     self.dirstack.push(self.packagedir)
     process.system('hg init .')
     process.system('hg add README.txt setup.py testpackage/__init__.py')
     process.system('hg commit -m"Import"')
     self.dirstack.pop()
     self.assertRaises(SystemExit, scms.get_scm, None, self.packagedir)
开发者ID:sixfeetup,项目名称:jarn.mkrelease,代码行数:11,代码来源:test_scmfactory.py

示例8: clone

# 需要导入模块: from jarn.mkrelease.process import Process [as 别名]
# 或者: from jarn.mkrelease.process.Process import system [as 别名]
 def clone(self):
     process = Process(quiet=True)
     process.system('git clone testpackage testclone')
     self.clonedir = join(self.tempdir, 'testclone')
     # Park the server on a branch
     self.dirstack.push('testpackage')
     process.system('git checkout parking')
     self.dirstack.pop()
     # Make sure the clone is on master
     self.dirstack.push('testclone')
     process.system('git checkout master')
     self.dirstack.pop()
开发者ID:sixfeetup,项目名称:jarn.mkrelease,代码行数:14,代码来源:testing.py

示例9: tag

# 需要导入模块: from jarn.mkrelease.process import Process [as 别名]
# 或者: from jarn.mkrelease.process.Process import system [as 别名]
 def tag(self, dir, tagid):
     process = Process(quiet=True)
     process.system('git tag %s' % tagid)
     process.system('git checkout %s' % tagid)
开发者ID:SalesSeek,项目名称:jarn.mkrelease,代码行数:6,代码来源:testing.py

示例10: update

# 需要导入模块: from jarn.mkrelease.process import Process [as 别名]
# 或者: from jarn.mkrelease.process.Process import system [as 别名]
 def update(self, dir):
     process = Process(quiet=True)
     process.system('git checkout master')
开发者ID:SalesSeek,项目名称:jarn.mkrelease,代码行数:5,代码来源:testing.py

示例11: remove

# 需要导入模块: from jarn.mkrelease.process import Process [as 别名]
# 或者: from jarn.mkrelease.process.Process import system [as 别名]
 def remove(self, dir):
     process = Process(quiet=True)
     process.system('git rm setup.py')
开发者ID:SalesSeek,项目名称:jarn.mkrelease,代码行数:5,代码来源:testing.py

示例12: branch

# 需要导入模块: from jarn.mkrelease.process import Process [as 别名]
# 或者: from jarn.mkrelease.process.Process import system [as 别名]
 def branch(self, dir, branchid):
     process = Process(quiet=True)
     process.system('hg branch %s' % branchid)
开发者ID:SalesSeek,项目名称:jarn.mkrelease,代码行数:5,代码来源:testing.py

示例13: modifyprop

# 需要导入模块: from jarn.mkrelease.process import Process [as 别名]
# 或者: from jarn.mkrelease.process.Process import system [as 别名]
 def modifyprop(self, dir):
     process = Process(quiet=True)
     if self.scm.version_info[:2] >= (1, 8):
         process.system('svn propset format "text/x-python" setup.py')
     else:
         process.system('svn propset svn:format "text/x-python" setup.py')
开发者ID:sixfeetup,项目名称:jarn.mkrelease,代码行数:8,代码来源:testing.py

示例14: modifyprop

# 需要导入模块: from jarn.mkrelease.process import Process [as 别名]
# 或者: from jarn.mkrelease.process.Process import system [as 别名]
 def modifyprop(self, dir):
     process = Process(quiet=True)
     process.system('svn propset svn:format "text/x-python" setup.py')
开发者ID:SalesSeek,项目名称:jarn.mkrelease,代码行数:5,代码来源:testing.py

示例15: test_simple

# 需要导入模块: from jarn.mkrelease.process import Process [as 别名]
# 或者: from jarn.mkrelease.process.Process import system [as 别名]
 def test_simple(self):
     process = Process()
     rc = process.system('echo "Hello world" > output')
     self.assertEqual(rc, 0)
     self.assertEqual(process.pipe('cat output'), 'Hello world')
开发者ID:Jarn,项目名称:jarn.mkrelease,代码行数:7,代码来源:test_process.py


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