Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _get_copyright(self, detail):
if detail == Detail.copyright_start_year:
return self._data["project"]["copyright"]["start_year"]
elif detail == Detail.copyright_copyrigtors:
return self._data["project"]["copyright"]["copyrightors"]
else:
mys.log("The config information named " + detail + " does not exist!", withError = True)
raise MiragefileUnknownError
def _get_project(self, detail):
if detail == Detail.project_name:
return self._data["project"]["name"]
elif detail == Detail.project_version:
return self._data["project"]["version"]
elif detail == Detail.project_author:
return self._data["project"]["author"]
elif detail == Detail.project_git:
return self._data["project"]["git"]
elif detail == Detail.project_license:
return self._data["project"]["license"]
elif detail == Detail.project_description:
return self._data["project"]["description"]
else:
mys.log("The config information named " + str(detail) + " does not exist!", withError = True)
raise MiragefileUnknownError
def _get_project(self, detail):
if detail == Detail.project_name:
return self._data["project"]["name"]
elif detail == Detail.project_version:
return self._data["project"]["version"]
elif detail == Detail.project_author:
return self._data["project"]["author"]
elif detail == Detail.project_git:
return self._data["project"]["git"]
elif detail == Detail.project_license:
return self._data["project"]["license"]
elif detail == Detail.project_description:
return self._data["project"]["description"]
else:
mys.log("The config information named " + str(detail) + " does not exist!", withError = True)
raise MiragefileUnknownError
def _get_project(self, detail):
if detail == Detail.project_name:
return self._data["project"]["name"]
elif detail == Detail.project_version:
return self._data["project"]["version"]
elif detail == Detail.project_author:
return self._data["project"]["author"]
elif detail == Detail.project_git:
return self._data["project"]["git"]
elif detail == Detail.project_license:
return self._data["project"]["license"]
elif detail == Detail.project_description:
return self._data["project"]["description"]
else:
mys.log("The config information named " + str(detail) + " does not exist!", withError = True)
raise MiragefileUnknownError
def _get_private_profile(self, detail):
if detail == Detail.private_name:
return self._data["private_profile"]["name"]
elif detail == Detail.private_license_url:
return self._data["private_license"]["url"]
else:
mys.log("The config information named " + detail + " does not exist!", withError = True)
raise MiragefileUnknownError
def _get_django(self, detail):
if detail == Detail.django_path:
return self._data["project"]["django"]["path"]
elif detail == Detail.django_module:
return self._data["project"]["django"]["module"]
elif detail == Detail.django_package_manager:
return self._data["project"]["django"]["package"]
elif detail == Detail.django_db_backend:
return self._data["project"]["django"]["database"]
else:
mys.log("The config information named " + str(detail) + " does not exist!", withError = True)
raise MiragefileUnknownError
def _get_private_profile(self, detail):
if detail == Detail.private_name:
return self._data["private_profile"]["name"]
elif detail == Detail.private_license_url:
return self._data["private_license"]["url"]
else:
mys.log("The config information named " + detail + " does not exist!", withError = True)
raise MiragefileUnknownError
def _get_django(self, detail):
if detail == Detail.django_path:
return self._data["project"]["django"]["path"]
elif detail == Detail.django_module:
return self._data["project"]["django"]["module"]
elif detail == Detail.django_package_manager:
return self._data["project"]["django"]["package"]
elif detail == Detail.django_db_backend:
return self._data["project"]["django"]["database"]
else:
mys.log("The config information named " + str(detail) + " does not exist!", withError = True)
raise MiragefileUnknownError
def main(self):
try:
proj_name = Config().get(Category.project_basic, Detail.project_name)
except:
proj_name = mys.log("What's the project name?", withInput = True)
try:
your_name = Config("secret").get(Category.private_profile, Detail.private_name)
except:
your_name = mys.log("What's your name?", withInput = True)
try:
start_year = Config().get(Category.copyright, Detail.copyright_start_year)
except:
start_year = mys.log("Start year", withInput = True)
try:
copyrights = Config().get(Category.copyright, Detail.copyright_copyrigtors)
except:
def _get_django(self, detail):
if detail == Detail.django_path:
return self._data["project"]["django"]["path"]
elif detail == Detail.django_module:
return self._data["project"]["django"]["module"]
elif detail == Detail.django_package_manager:
return self._data["project"]["django"]["package"]
elif detail == Detail.django_db_backend:
return self._data["project"]["django"]["database"]
else:
mys.log("The config information named " + str(detail) + " does not exist!", withError = True)
raise MiragefileUnknownError