Skip to content

Commit 393f93a

Browse files
committed
移除对 SAE 的依赖,增加 SAE 分支
1 parent e157fed commit 393f93a

File tree

5 files changed

+4
-53
lines changed

5 files changed

+4
-53
lines changed

README.markdown

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* [web.py]( http://webpy.org/)
77
* [python-qrcode](https://github.com/lincolnloop/python-qrcode)
88
* [PIL](http://www.pythonware.com/products/pil/index.htm)
9-
* [SAE](http://sae.sina.com.cn/)
109

1110
## 功能
1211

@@ -22,10 +21,6 @@
2221
* chs='300x300' 图片尺寸(必需)
2322
* chld='M|4' 纠错级别(L(7%),M(15%),Q(25%),H(30%))及二维码离图片边框的距离(非必需,默认为'M|4')
2423

25-
## TODO
26-
27-
i18n
28-
2924
## Demo
3025

3126
<http://pyqr.sinaapp.com>

config.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

index.wsgi

Lines changed: 0 additions & 20 deletions
This file was deleted.

main.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,11 @@
2828
'/qr', 'QR', # 二维码图片
2929
)
3030

31-
# 判断是线上还是本地环境
32-
if 'SERVER_SOFTWARE' in os.environ:
33-
# SAE
34-
site = 'http://%s.sinaapp.com' % (os.environ.get('APP_NAME'))
35-
else:
36-
# Local
37-
site = 'http://127.0.0.1:8080' # TODO 获取自定义的端口
38-
3931
# 应用模板
4032
app_root = os.path.dirname(__file__) # 文件所在文件夹路径
4133
templates_root = os.path.join(app_root, 'templates') # 模板路径
4234
render = web.template.render(templates_root)
4335
app = web.application(urls, globals())
44-
web.template.Template.globals['site'] = site # 模板全局变量
4536

4637

4738
class Index(object):

templates/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<meta charset="utf-8" />
1010
<meta name="description" content="Online QR Code Generator" />
11-
<link href="$site/static/favicon.ico" rel="shortcut icon" type="image/x-icon" />
11+
<link href="/static/favicon.ico" rel="shortcut icon" type="image/x-icon" />
1212
<style>
1313
body, ul, select, button {
1414
font-family: Arial Unicode MS,Arial,sans-serif;
@@ -87,7 +87,7 @@
8787
}
8888

8989
.required {
90-
background: url("$site/static/required-field-bg.png") repeat-y scroll 0 0 #FFFFFF;
90+
background: url("/static/required-field-bg.png") repeat-y scroll 0 0 #FFFFFF;
9191
}
9292

9393
.fixed {
@@ -104,7 +104,7 @@
104104
-moz-border-left-colors: none;
105105
-moz-border-right-colors: none;
106106
-moz-border-top-colors: none;
107-
background: url("$site/static/hborder.png") repeat-x scroll 0 -2077px transparent;
107+
background: url("/static/hborder.png") repeat-x scroll 0 -2077px transparent;
108108
border-color: #BBBBBB #BBBBBB #A0A0A0;
109109
border-radius: 3px 3px 3px 3px;
110110
border-style: solid;
@@ -136,7 +136,7 @@ <h1>
136136
</h1>
137137
</div>
138138
<div id="form">
139-
<form method="get" action="$site/qr">
139+
<form method="get" action="/qr">
140140
<ul class="none">
141141
<li class="first">
142142
<label for="text">Text content</label>

0 commit comments

Comments
 (0)