Skip to content

Commit 7597cce

Browse files
committed
server configurable
1 parent 103a11a commit 7597cce

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

apikey.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
SERVER = 'http://api.cn.faceplusplus.com/'
2+
# uncomment the following line to switch to US server
3+
# SERVER = 'http://api.us.faceplusplus.com/'
4+
15
API_KEY = '<your API key here>'
26
API_SECRET = '<your API secret here>'

cmdtool.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python2
22
# -*- coding: utf-8 -*-
33
# $File: cmdtool.py
4-
# $Date: Sat Nov 17 14:14:38 2012 +0800
4+
# $Date: Sat Apr 06 11:47:10 2013 +0800
55
# $Author: jiakai@megvii.com
66
#
77
# This program is free software. It comes without any warranty, to
@@ -42,8 +42,9 @@ def init():
4242
with open(os.path.join(fdir, 'apikey.cfg')) as f:
4343
exec(f.read())
4444

45+
srv = locals().get('SERVER')
4546
from facepp import API
46-
return API(API_KEY, API_SECRET)
47+
return API(API_KEY, API_SECRET, srv = srv)
4748

4849
api = init()
4950

0 commit comments

Comments
 (0)