提交 a2e55fb6 编写于 作者: S solarhu 提交者: Gitee

!38 File specification modification, including __init__ file description, single quote modification

Merge pull request !38 from gongzhengtang/master
#!/usr/bin/python3
'''
"""
Initial operation and configuration of the flask project
'''
"""
from flask import Flask
from flask_session import Session
from packageship.application.settings import Config
......@@ -11,9 +11,9 @@ OPERATION = None
def init_app(operation):
'''
"""
Project initialization function
'''
"""
app = Flask(__name__)
# log configuration
......
#!/usr/bin/python3
"""
Blueprint collection trying to page
"""
from packageship.application.apps.package import package, api as package_api
blue_point = [
......
......@@ -59,6 +59,15 @@ class InitDataBase():
if self.db_type not in ['mysql', 'sqlite']:
LOGGER.logger.error("database type configuration error")
raise Error('database type configuration error')
self._src_requires_dicts = dict()
self._bin_package_dicts = dict()
self._bin_package_name = dict()
self._bin_requires_dicts = dict()
self._bin_provides_dicts = dict()
self._src_packages = dict()
self._src_package_names = dict()
self._sqlite_db = None
self.requires = dict()
def __read_config_file(self):
"""
......
......@@ -40,6 +40,7 @@ class MergeData():
self.bin_provides_dicts = dict()
self.bin_package_datas = []
self.mainter_infos = dict()
self.bin_requires_dicts = dict()
@staticmethod
def __columns(cursor):
......
......@@ -10,7 +10,6 @@ from packageship.libs.dbutils.sqlalchemy_helper import DBHelper
class src_pack(DBHelper.BASE): # pylint: disable=C0103,R0903
"""
Description: functional description:Source package model
modify record:
"""
__tablename__ = 'src_pack'
......@@ -35,7 +34,6 @@ class src_pack(DBHelper.BASE): # pylint: disable=C0103,R0903
class bin_pack(DBHelper.BASE): # pylint: disable=C0103,R0903
"""
Description: functional description:Binary package data
modify record:
"""
__tablename__ = 'bin_pack'
......@@ -51,10 +49,9 @@ class bin_pack(DBHelper.BASE): # pylint: disable=C0103,R0903
class pack_requires(DBHelper.BASE): # pylint: disable=C0103,R0903
'''
"""
functional description:
modify record:
'''
"""
__tablename__ = 'pack_requires'
......@@ -72,10 +69,9 @@ class pack_requires(DBHelper.BASE): # pylint: disable=C0103,R0903
class pack_provides(DBHelper.BASE): # pylint: disable=C0103,R0903
'''
"""
functional description:
modify record:
'''
"""
__tablename__ = 'pack_provides'
id = Column(Integer, primary_key=True)
......@@ -86,9 +82,9 @@ class pack_provides(DBHelper.BASE): # pylint: disable=C0103,R0903
class maintenance_info(DBHelper.BASE): # pylint: disable=C0103,R0903
'''
"""
Maintain data related to person information
'''
"""
__tablename__ = 'maintenance_info'
id = Column(Integer, primary_key=True)
......
#!/usr/bin/python3
"""
Encapsulation of public class methods
"""
#!/usr/bin/python3
"""
Database access public class method
"""
from .sqlalchemy_helper import DBHelper
__all__ = ['DBHelper']
\ No newline at end of file
__all__ = ['DBHelper']
#!/usr/bin/python3
"""
Customized exception information class
"""
from packageship.libs.exception.ext import ContentNoneException
from packageship.libs.exception.ext import DatabaseRepeatException
from packageship.libs.exception.ext import DataMergeException
......
#!/usr/bin/python3
"""
Common methods for logging
"""
from packageship.libs.log.loghelper import setup_log
from packageship.libs.log.loghelper import Log
......
#!/usr/bin/python3
'''
"""
Logging related
'''
"""
import os
import pathlib
import logging
......@@ -13,9 +13,9 @@ READCONFIG = ReadConfig()
def setup_log(config=None):
'''
"""
Log logging in the context of flask
'''
"""
if config:
logging.basicConfig(level=config.LOG_LEVEL)
else:
......@@ -47,9 +47,9 @@ def setup_log(config=None):
class Log():
'''
"""
General log operations
'''
"""
def __init__(self, name=__name__, path=None):
self.__name = name
......@@ -95,17 +95,17 @@ class Log():
self.__file_handler.setFormatter(formatter)
def close_handler(self):
'''
"""
Turn off log processing
'''
"""
# self.__stream_handler.close()
self.__file_handler.close()
@property
def logger(self):
'''
"""
Get logs
'''
"""
self.__ini_handler()
self.__set_handler()
self.__set_formatter()
......
#!/usr/bin/python3
"""
Package management program installation configuration
file for software packaging
"""
from distutils.core import setup
import os
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册