Skip to content

Commit 7b6f8b0

Browse files
committed
-w-
1 parent 39d7d08 commit 7b6f8b0

File tree

3 files changed

+102
-3
lines changed

3 files changed

+102
-3
lines changed

NKUCodingCat/0024/0024.sql

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# SQL-Front 5.1 (Build 4.16)
2+
3+
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE */;
4+
/*!40101 SET SQL_MODE='NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */;
5+
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES */;
6+
/*!40103 SET SQL_NOTES='ON' */;
7+
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS */;
8+
/*!40014 SET UNIQUE_CHECKS=0 */;
9+
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS */;
10+
/*!40014 SET FOREIGN_KEY_CHECKS=0 */;
11+
12+
13+
# Host: localhost Database: 0024
14+
# ------------------------------------------------------
15+
# Server version 5.5.38
16+
17+
DROP DATABASE IF EXISTS `0024`;
18+
CREATE DATABASE `0024` /*!40100 DEFAULT CHARACTER SET utf8 */;
19+
USE `0024`;
20+
21+
#
22+
# Source for table code
23+
#
24+
25+
DROP TABLE IF EXISTS `code`;
26+
CREATE TABLE `code` (
27+
`id` int(20) NOT NULL DEFAULT '0',
28+
`to` text NOT NULL
29+
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
30+
31+
#
32+
# Dumping data for table code
33+
#
34+
35+
LOCK TABLES `code` WRITE;
36+
/*!40000 ALTER TABLE `code` DISABLE KEYS */;
37+
/*!40000 ALTER TABLE `code` ENABLE KEYS */;
38+
UNLOCK TABLES;
39+
40+
#
41+
# Source for table max
42+
#
43+
44+
DROP TABLE IF EXISTS `max`;
45+
CREATE TABLE `max` (
46+
`pro` varchar(255) DEFAULT NULL,
47+
`max` int(11) NOT NULL
48+
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
49+
50+
#
51+
# Dumping data for table max
52+
#
53+
54+
LOCK TABLES `max` WRITE;
55+
/*!40000 ALTER TABLE `max` DISABLE KEYS */;
56+
INSERT INTO `max` VALUES ('max',0);
57+
/*!40000 ALTER TABLE `max` ENABLE KEYS */;
58+
UNLOCK TABLES;
59+
60+
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
61+
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
62+
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
63+
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;

NKUCodingCat/0024/SQLIO.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import time, os, json, MySQLdb, HTMLParser, cgi
2+
def SQL_init():
3+
db = MySQLdb.connect("127.0.0.1","root","root","0024" )
4+
return db.cursor()
5+
def SQL_max(new=None):
6+
cursor = SQL_init()
7+
if new != None
8+
sql="""UPDATE `max` SET `max`=%d WHERE `pro`='max'"""%new
9+
cursor.execute(sql)
10+
return True
11+
else:
12+
sql="""SELECT * FROM `max` WHERE `pro`='max'"""
13+
cursor.execute(sql)
14+
return cursor.fetchall()[0][1]
15+
def SQL_in(task):
16+
max = SQL_max()
17+
18+
def SQL_out():
19+
cursor = SQL_init()
20+
sql = """SELECT * FROM `code`"""
21+
cursor.execute(sql)
22+
return cursor.fetchall()

NKUCodingCat/0024/main.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@
8989
"""
9090

9191

92-
from bottle import static_file,route, run, post, request, redirect
92+
from bottle import static_file,route, run, post, request, redirect, error
9393
import os, urllib,re,json,time
9494
Root = os.path.split(os.path.realpath(__file__))[0]+"/static/"
95-
95+
import SQLIO
9696

9797
@route('/todo')
9898
def index():
@@ -105,5 +105,19 @@ def Accept():
105105
for i in L:
106106
A = re.split("=",i)
107107
M[A[0]] = urllib.unquote(A[1])
108-
return json.dumps(M)
108+
for j in M.keys():
109+
if re.findall("id-",j):
110+
return "Delete",j[3:]
111+
try:
112+
type = M["new"]
113+
newtask = M["newtask"]
114+
if newtask != "":
115+
return newtask
116+
else:
117+
return "=.=所以你想添加什么任务呀"
118+
except:
119+
return "虽然不知道你在干什么但是触发了服务器错误呢"
120+
@route('/error')
121+
def err():
122+
return "虽然不知道你在干什么但是触发了服务器错误呢"
109123
run(host='localhost',port=8080)

0 commit comments

Comments
 (0)