Permalink
Browse files

improve README; base_dir and data_dir; fix several trailing whtespace…

…; remove debug in telnet server
  • Loading branch information...
1 parent cad838f commit a4a90024757628b3e4c89401c9a22a32b9885a12 @dengzhp dengzhp committed Jul 27, 2012
Showing with 13 additions and 20 deletions.
  1. +5 −5 README.md
  2. +2 −2 admin.py
  3. +1 −1 admin.sh
  4. +2 −6 argo_conf.py
  5. +1 −2 model/config.py
  6. +1 −3 model/globaldb.py
  7. +1 −1 telnet/server.py
View
@@ -42,7 +42,7 @@ Overview
> ---------- ---------------
> | Mysql | redis |
> ------------------------
-
+
采用python实现。
Dependencies
@@ -54,6 +54,7 @@ Dependencies
* python-redis
* eventlet
* bcrypt
+ * chaofeng
其中jinja2目前被telnet端使用,可能会被web端使用。
@@ -67,13 +68,13 @@ Install
### 获取本项目
```bash
-git clone https://github.com/argo-admin/argon.git
+git clone https://github.com/argolab/argon.git
```
测试一下需要的依赖是否被满足:
```bash
-python -c 'import MySQLdb,eventlet,jinjia2,redis'
+python -c 'import MySQLdb,eventlet,jinja2,redis,bcrypt'
```
应该没有任何异常输出。
@@ -110,7 +111,7 @@ class ConfigCache:
### 初始化数据库
-我们目前提供一个简单的python脚本:
+首选需要根据上面ConfigDB的配置创建数据库和用户,然后使用我们目前提供的一个简单的python脚本创建数据库表:
```bash
./admin.sh
@@ -152,4 +153,3 @@ $ telnet localhost 5000
接口参加源代码。
telnet端的更多说明见`telnet/README.md`
-
View
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/env python
# -*- coding: utf-8 -*-
import model
@@ -7,7 +7,7 @@
from argo_conf import ConfigTestDate as t
manager = model.manager
-
+
def init_database():
u'''
初始化数据库。
View
@@ -2,4 +2,4 @@
# Just load the test admin.py
-python2 -i ./admin.py
+python -i ./admin.py
View
@@ -10,12 +10,8 @@ class ConfigBase:
Basic config
'''
import os
- if os.popen('whoami').read() == 'hbl\n':
- base_dir = '/Users/hbl/source'
- else:
- base_dir = '/home/mo'
-
- data_dir = ''
+ base_dir = os.path.dirname(os.path.abspath(__file__))
+ data_dir = os.path.join(base_dir, 'database/')
class ConfigDB:
'''
View
@@ -20,6 +20,5 @@
''' Other setting '''
-SQL_TPL_DIR = ConfigBase.base_dir + '/argon/database/'
+SQL_TPL_DIR = ConfigBase.data_dir
BASE_TABLE = [ 'attachead','boardhead','sectionhead','user','userattr']
-
View
@@ -6,12 +6,10 @@
import redis
class GlobalDB(object):
-
+
conn = dbapi.Connection(host=HOST+':'+str(PORT), user=USER, password=PASSWD, database=DBNAME)
cache = redis.Redis(host=CHOST, port=CPORT)
global_conn = GlobalDB.conn
global_cache = GlobalDB.cache
-
-
View
@@ -20,7 +20,7 @@ def initialize(self):
# self.goto('dd')
# self.goto('post','Test1','3')
-config.root = 'debug'
+#config.root = 'debug'
if __name__ == '__main__' :
s = Server(mark[config.root])

0 comments on commit a4a9002

Please sign in to comment.