Skip to content

Instantly share code, notes, and snippets.

@pypeach
Created May 15, 2018 12:35
Show Gist options
  • Save pypeach/ca807daef79fedcc3d9970068814b819 to your computer and use it in GitHub Desktop.
Save pypeach/ca807daef79fedcc3d9970068814b819 to your computer and use it in GitHub Desktop.
アプリ基底クラス
# 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