Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Decalogue committed Jun 29, 2020
1 parent 583cde9 commit dcd26b6
Show file tree
Hide file tree
Showing 15 changed files with 1,424 additions and 86 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ AI
Overview
========

`AI is an artificial intelligence tool lib. AI 是一个人工智能工具库`
`AI is a simple and easy-to-use artificial intelligence tool library. AI 是一个简单好用的人工智能工具库`

Requirements
============

* Python 3.3+
* Python 3.5+
* Works on Linux, Windows, Mac OSX, MIT

Install
Expand Down
2 changes: 0 additions & 2 deletions ai/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# -*- coding: utf-8 -*-

"""Ai lib."""
11 changes: 6 additions & 5 deletions ai/iconf.py → ai/conf.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# -*- coding: utf-8 -*-
""" ai.conf """

import os
import yaml
from configparser import ConfigParser


class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = self
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = self


def get_yaml(path):
"""yaml 方式配置
"""
return AttrDict(yaml.load(open(path, 'r')))
return AttrDict(yaml.load(open(path, 'r')))


def get_conf(path):
Expand Down Expand Up @@ -66,7 +67,7 @@ def __init__(self, filepath=None):
self.path = filepath
else:
cur_dir = os.path.split(os.path.realpath(__file__))[0]
self.path = os.path.join(cur_dir, "conf", "self.conf")
self.path = os.path.join(cur_dir, "self.conf")
self.conf = get_conf(self.path)
self.d = Dict()
for s in self.conf.sections():
Expand Down
4 changes: 0 additions & 4 deletions ai/conf/self.conf

This file was deleted.

Loading

0 comments on commit dcd26b6

Please sign in to comment.