Exemplo n.º 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
Exemplo n.º 2
0
# 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)
Exemplo n.º 3
0
# 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)