Remove useless attribute data_dir

This commit is contained in:
Mikhail Gordeev 2020-04-15 23:06:19 +03:00
parent 11dbf8ad02
commit 0f19ea0bd5
2 changed files with 0 additions and 18 deletions

View File

@ -1,20 +1,12 @@
#!/usr/bin/python3
import argparse
import os
from cloud_build import CB
PROG = 'cloud-build'
def get_data_dir() -> str:
data_dir = (os.getenv('XDG_DATA_HOME',
os.path.expanduser('~/.local/share'))
+ f'/{PROG}/')
return data_dir
def parse_args():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
@ -25,12 +17,6 @@ def parse_args():
default=f'/etc/{PROG}/config.yaml',
help='path to config',
)
parser.add_argument(
'-d',
'--data-dir',
default=f'/usr/share/{PROG}',
help='system data directory',
)
parser.add_argument(
'--no-tests',
action='store_true',
@ -38,9 +24,6 @@ def parse_args():
)
args = parser.parse_args()
if not args.data_dir.endswith('/'):
args.data_dir += '/'
return args

View File

@ -36,7 +36,6 @@ class CB:
self.images_dir = data_dir / 'images'
self.work_dir = data_dir / 'work'
self.out_dir = data_dir / 'out'
self.system_datadir = args.data_dir
self.date = datetime.date.today().strftime('%Y%m%d')
self.service_default_state = 'enabled'