コード例 #1
0
def get(request, device):
        if device[-1]=="/": device=device[:-1]
        resp=HttpResponse("", mimetype="text/plain")
        resp["Content-Type"]="text/plain; charset=utf-8"
        w=getWeather(device)
        resp.write(u"\n".join(w))
        return resp
コード例 #2
0
ファイル: weatherview.py プロジェクト: yongming/iclock-python
def get(request, device):
	if device[-1]=="/": device=device[:-1]
	resp=HttpResponse("", mimetype="text/plain")
	resp["Content-Type"]="text/plain; charset=utf-8"
	w=getWeather(device)
	resp.write(u"\n".join(w))
	return resp
コード例 #3
0
def get(request, device):
    if device[-1] == '/':
        device = device[:-1]
    resp = HttpResponse('', mimetype='text/plain')
    resp['Content-Type'] = 'text/plain; charset=utf-8'
    w = getWeather(device)
    resp.write((u'\n').join(w))
    return resp
コード例 #4
0
def get(request, device):
	if device[-1]=="/": device=device[:-1]
	resp=HttpResponse("", mimetype="text/plain")
	resp["Content-Type"]="text/plain; charset=utf-8"
	if "msg" in settings.ENABLED_MOD:
		w=getWeather(device)
		resp.write(u"\n".join(w))
		return resp
	else:
		return render_to_response("info.html", {"title":  _("Error"), "content": _("The server is not installed information services module!")});
コード例 #5
0
ファイル: genmsgview.py プロジェクト: leancode/iclock-python2
def get(request, device):
    if device[-1] == '/':
        device = device[:-1]
    resp = HttpResponse('', mimetype='text/plain')
    resp['Content-Type'] = 'text/plain; charset=utf-8'
    if 'msg' in settings.ENABLED_MOD:
        w = getWeather(device)
        resp.write((u'\n').join(w))
        return resp
    return render_to_response(
        'info.html', {
            'title':
            _('Error'),
            'content':
            _('The server is not installed information services module!')
        })