1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-25 01:16:14 +01:00
github.com_openSUSE_osc/osc-wrapper.py
Sascha Peilicke 438569f821 PEP8-ified parts of the code.
Exchange individual return statements with a finally statement in the
big try/except statement in babysitter.py. If you return a different
value in the 'except' clause, it takes precedency over the 'finally'
clause (finally is executed before returning, naturally).
2011-07-08 16:09:44 +02:00

24 lines
562 B
Python
Executable File

#!/usr/bin/env python
# this wrapper exists so it can be put into /usr/bin, but still allows the
# python module to be called within the source directory during development
import locale
import sys
from osc import commandline, babysitter
# this is a hack to make osc work as expected with utf-8 characters,
# no matter how site.py is set...
reload(sys)
loc = locale.getdefaultlocale()[1]
if not loc:
loc = sys.getdefaultencoding()
sys.setdefaultencoding(loc)
del sys.setdefaultencoding
osccli = commandline.Osc()
r = babysitter.run(osccli)
sys.exit(r)