コード例 #1
0
def run_repo(args, stdin = ''):
	oldcwd = os.getcwd()

	old_stdout = sys.stdout
	sys.stdout = StringIO()
	try:
		sys.stdin = StringIO(stdin + '\n')	# (simulate pressing Return if needed)
		main(['0repo'] + args)
		return sys.stdout.getvalue()
	finally:
		os.chdir(oldcwd)
		sys.stdout = old_stdout
コード例 #2
0
ファイル: 0repo.py プロジェクト: pombredanne/0repo
# Copyright (C) 2013, Thomas Leonard
# See the README file for details, or visit http://0install.net.
import sys
from repo import cmd
from zeroinstall import SafeException

version = '0.2'

try:
	cmd.main(sys.argv)
except SafeException as ex:
	import logging
	if logging.getLogger().isEnabledFor(logging.INFO):
		raise

	print(ex)
	sys.exit(1)
コード例 #3
0
ファイル: 0repo.py プロジェクト: benjamin-hg/0repo
# Copyright (C) 2013, Thomas Leonard
# See the README file for details, or visit http://0install.net.
import sys
from repo import cmd
from zeroinstall import SafeException

version = '0.5.1'

try:
	cmd.main(sys.argv)
except SafeException as ex:
	import logging
	if logging.getLogger().isEnabledFor(logging.INFO):
		raise

	print(ex)
	sys.exit(1)