Skip to content

Instantly share code, notes, and snippets.

@pypeach
pypeach / thread_pool_executor_operate_db.py
Created July 23, 2018 13:34
マルチスレッド処理を行うサンプルアプリケーションです
# coding:utf-8
import concurrent
import logging
from concurrent import futures
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime
from time import sleep
from app.app_logic_base import AppLogicBase
from app.enum.gender_type import GenderType
@pypeach
pypeach / app_logic_base.py
Created May 15, 2018 12:35
アプリ基底クラス
# coding:utf-8
import os
from pathlib import PurePath
from util import app_config
"""
appクラスの基底クラスです。
"""
__author__ = "t.ebinuma"
@pypeach
pypeach / test_write_csv_file.py
Created May 1, 2018 08:05
CSV書き込みテスト
# coding:utf-8
import unittest
from app.write_csv_file import WriteCsvFile
from sql import emp
from test.unit_test_base import UnitTestBase
"""
CSVファイル書き込みを行うサンプルアプリケーションのテストです
"""
@pypeach
pypeach / test_read_csv_file.py
Created May 1, 2018 08:05
CSV読み込みテスト
# coding:utf-8
import unittest
from app.read_csv_file import ReadCsvFile
from sql import fruit
from test.unit_test_base import UnitTestBase
"""
CSVファイル読み込みを行うサンプルアプリケーションのテストです
"""
@pypeach
pypeach / unit_test_base.py
Last active July 23, 2018 13:05
テスト基底クラス
# coding:utf-8
import filecmp
import logging
import os
import unittest
from app.sql import sql_common
from app.util import app_config, file_access, message_access, string_helper, db_access
"""
@pypeach
pypeach / app_config.py
Last active July 23, 2018 12:53
アプリケーション設定制御
# coding:utf-8
import logging
import logging.config
import os
import sys
import yaml
from app.util import db_access, string_helper
@pypeach
pypeach / write_csv_file.py
Last active July 23, 2018 13:15
CSV書き込みを行うサンプルアプリケーションです
# coding:utf-8
import csv
import logging
import os
from app.app_logic_base import AppLogicBase
from app.sql import employees
from app.util import app_config, message_access, date_helper
"""
@pypeach
pypeach / rotate_log_file.py
Last active July 23, 2018 13:13
ログファイルのローテーションを行うサンプル
# coding:utf-8
import datetime
import glob
import logging
import os
from app.util import app_config, date_helper
"""
ログファイルをローテーション(バックアップと過去ファイル削除)するサンプルアプリケーションです
@pypeach
pypeach / send_mail.py
Last active July 23, 2018 13:08
メール送信を行うサンプルアプリケーションです
# coding:utf-8
import logging
from app.app_logic_base import AppLogicBase
from app.util import message_access, app_config, mail_sender
"""
メール送信するサンプルアプリケーションです
"""
__author__ = "t.ebinuma"
@pypeach
pypeach / mail_sender.py
Last active July 23, 2018 13:09
メール送信のユーティリティ
# coding:utf-8
import email
import email.header
import imghdr
import logging
import mimetypes
import os
import smtplib
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart