mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-06 07:20:29 +03:00
Replace sys.exit() in non-main functions by exceptions
Also move all exceptions into one module
This commit is contained in:
parent
a8420817cb
commit
1fcd8e63a3
17 changed files with 119 additions and 141 deletions
|
|
@ -28,6 +28,7 @@ from argparse import ArgumentParser
|
|||
import logging
|
||||
|
||||
from . import common
|
||||
from .exception import FDroidException
|
||||
|
||||
config = {}
|
||||
options = None
|
||||
|
|
@ -117,7 +118,7 @@ def main():
|
|||
if common.test_sdk_exists(test_config):
|
||||
break
|
||||
if not common.test_sdk_exists(test_config):
|
||||
sys.exit(3)
|
||||
raise FDroidException("Android SDK not found.")
|
||||
|
||||
if not os.path.exists('config.py'):
|
||||
# 'metadata' and 'tmp' are created in fdroid
|
||||
|
|
@ -135,7 +136,7 @@ def main():
|
|||
else:
|
||||
logging.warn('Looks like this is already an F-Droid repo, cowardly refusing to overwrite it...')
|
||||
logging.info('Try running `fdroid init` in an empty directory.')
|
||||
sys.exit()
|
||||
raise FDroidException('Repository already exists.')
|
||||
|
||||
if 'aapt' not in test_config or not os.path.isfile(test_config['aapt']):
|
||||
# try to find a working aapt, in all the recent possible paths
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue