Created
May 15, 2018 12:35
-
-
Save pypeach/ca807daef79fedcc3d9970068814b819 to your computer and use it in GitHub Desktop.
アプリ基底クラス
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding:utf-8 | |
import os | |
from pathlib import PurePath | |
from util import app_config | |
""" | |
appクラスの基底クラスです。 | |
""" | |
__author__ = "t.ebinuma" | |
__version__ = "1.0" | |
__date__ = "14 May 2018" | |
class AppLogicBase: | |
def __init__(self): | |
# アプリケーションの初期化を行う | |
app_config.init() | |
@staticmethod | |
def get_app_name(file_path): | |
""" | |
app+pythonファイル名を取得する。 | |
loggerに指定するために使用する。 | |
""" | |
path = os.path.abspath(file_path) | |
package = PurePath(path).parent.name | |
name, ext = os.path.splitext(PurePath(path).name) | |
return package + "." + name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment