Skip to content
This repository has been archived by the owner on Apr 20, 2021. It is now read-only.

Commit

Permalink
Merge pull request #107 from YetAnotherPackageInstaller/patch.config.dir
Browse files Browse the repository at this point in the history
Patch.config.dir
  • Loading branch information
Wabri committed Feb 17, 2019
2 parents ec76fad + 0bc2d37 commit 3bda0ae
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config.ini → config/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ yapi_dir =
platform =
file_extension = .sh
language = en
language_dir = ${yapi_dir}/modules/languages/pack
language_dir = ${yapi_dir}/config/languages

[INSTALL]
soft_link = /usr/local/bin
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import sys

config = ConfigParser(interpolation=ExtendedInterpolation())
real_config_path = os.path.realpath(
__file__).rstrip("install.py") + "config.ini"
real_path = os.path.realpath(__file__)
real_config_path = real_path.rstrip("install.py") + "config/config.ini"
config.read(real_config_path)

yapi_real_path = os.path.realpath(__file__).rstrip("/install.py")
Expand Down
2 changes: 1 addition & 1 deletion modules/configuration/config_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def get_configuration():
from os import path
config = ConfigParser(interpolation=ExtendedInterpolation())
config.read(path.realpath(__file__).rstrip(
"modules/configuration/config_extractor.py") + "/config.ini")
"modules/configuration/config_extractor.py") + "/config/config.ini")
configuration = dict()
for key in config.keys():
configuration[key] = dict()
Expand Down
5 changes: 3 additions & 2 deletions modules/languages/language_pack_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ def get_language_pack():
from configparser import ConfigParser
from modules.configuration.config_extractor import get_configuration
config = get_configuration()
language_config_file = str(config["COMMON"]["language_dir"]) + "/" + \
config["COMMON"]["language"] + ".ini"
language_dir = str(config["COMMON"]["language_dir"])
language_name = str(config["COMMON"]["language"])
language_config_file = language_dir + "/" + language_name + ".ini"
language_config = ConfigParser()
language_config.read(language_config_file)
language_pack = dict()
Expand Down

0 comments on commit 3bda0ae

Please sign in to comment.