OSDN Git Service

raw added
authoryamat0jp <yamat0jp@yahoo.co.jp>
Tue, 22 Nov 2016 10:44:30 +0000 (19:44 +0900)
committeryamat0jp <yamat0jp@yahoo.co.jp>
Tue, 22 Nov 2016 10:44:30 +0000 (19:44 +0900)
__pycache__/index.cpython-35.pyc
index.py
static/db/db.json

index 997c278..b61db88 100644 (file)
Binary files a/__pycache__/index.cpython-35.pyc and b/__pycache__/index.cpython-35.pyc differ
index ad6aa91..867e878 100755 (executable)
--- a/index.py
+++ b/index.py
@@ -41,9 +41,6 @@ class IndexHandler(BaseHandler):
             if start < 0:
                 start = 0
         rec = sorted(table.all(),key=lambda x: x['number'])[start:start+i]
-        for x in rec:
-            for y in x['comment'].splitlines(True):
-                y = '<p>'+y+'<br></p>'
         if len(table) >= 10*i:
             self.render('modules/full.htm',position=pos,records=rec,data=params,db=dbname)
             return
@@ -135,7 +132,7 @@ class RegistHandler(tornado.web.RequestHandler):
                 if word in line:
                     error = error + u'タグ違反.('+word+')'       
             i += len(line)
-            text = text+self.link(line)
+            text = text+'<p>'+self.link(line)+'<br></p>'
         pw = self.get_argument('password')
         if sub == '':
             sub = u'タイトルなし.'
@@ -150,7 +147,7 @@ class RegistHandler(tornado.web.RequestHandler):
             item = sorted(article.all(),key=lambda x: x['number'])[len(article)-1]
             no = item['number']+1
         if error == '':
-            reg = {'number':no,'name':na,'title':sub,'comment':text,'password':pw,'date':datetime.now().strftime('%Y/%m/%d %H:%M')}
+            reg = {'number':no,'name':na,'title':sub,'comment':text,'raw':com,'password':pw,'date':datetime.now().strftime('%Y/%m/%d %H:%M')}
             article.insert(reg)
             restart()
             self.set_cookie('username',tornado.escape.url_escape(na))
@@ -268,9 +265,6 @@ class SearchHandler(tornado.web.RequestHandler):
         self.word = tornado.escape.url_unescape(self.get_argument('word1'))
         self.radiobox = self.get_argument('filter')
         self.set_cookie('search',tornado.escape.url_escape(self.word))         
-        table = self.application.db.table(dbname)
-        #rec = table.search(where(radiobox).search(word))
-        #rec = sorted(rec,key=lambda x: x['number'])
         rec = self.search(dbname)
         self.render('modules/search.htm',records=rec,word1=self.word,db=dbname)
     
@@ -288,7 +282,7 @@ class SearchHandler(tornado.web.RequestHandler):
             for x in table.search(where('comment').search(word)):
                 if self.radiobox == 'comment':
                     result = ''
-                    for text in x['comment'].splitlines(True):                  
+                    for text in x['raw'].splitlines(True):                  
                         if text.find(word) > -1:
                             result = result+'<p style=background-color:yellow>'+text+'</p>'                            
                         else:
index 1c42c64..6f199c2 100644 (file)
@@ -1 +1 @@
-{"bb1": {}, "bbs2": {}, "bbs": {"1": {"date": "2016/11/18/16:17", "title": "\u3053\u306eBBS\u306f\u3059\u3054\u3044\u3067\u3059\u3002\u3002\u3002\uff20\uff20\uff1b", "number": 1, "comment": "<p>\u3053\u306e\u63b2\u793a\u677f\u306f\u3059\u3054\u3044\u3067\u3059\u3002\u4f55\u304c\u3059\u3054\u3044\u306e\u304b\u5229\u7528\u8005\u306b\u306f\u308f\u304b\u3089\u306a\u3044\u3067\u3057\u3087\u3046\u3051\u308c\u3069\u3001\u7ba1\u7406\u8005\u306f\u7ba1\u7406\u304c\u3057\u3084\u3059\u3044\u3067\u3059\u3002\u7c21\u5358\u306b\u904b\u7528\u3067\u304d\u307e\u3059\u3002heroku\u3067git\u3059\u308c\u3070\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u30af\u30ea\u30a2\u3057\u3066\u3059\u3050\u4f7f\u3048\u308b\u72b6\u614b\u306b\u306a\u308a\u307e\u3059\u3002\u6c17\u306b\u3057\u306a\u3044\u4eba\u306f\u305d\u306e\u307e\u307e\u4f7f\u3048\u307e\u3059\u3002\r\n<p>\u3000tornado\u3092\u4f7f\u7528\u3057\u3066\u66f8\u304b\u308c\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304c\u5927\u5909\u7c21\u7d20\u3067\u3059\u3002\u306a\u304a\u304b\u3064\u30d6\u30ed\u30b0\u30b7\u30b9\u30c6\u30e0\u306b\u30a2\u30c3\u30d7\u304c\u30b0\u30ec\u30fc\u30c9\u3055\u305b\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002\r\n<p>\u3000\u63b2\u793a\u677f\u306e\u7ba1\u7406\u306b\u5fc5\u8981\u306a\u62e1\u5f35\u3067\u3059\u304c\u30c1\u30e3\u30f3\u30cd\u30eb\u306e\u8ffd\u52a0\u306f\u7ba1\u7406\u8005\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u8ffd\u52a0\u3057\u305f\u3044URL\u3092\u6253\u3061\u8fbc\u3080\u3060\u3051\u3002\u305d\u3046\u3059\u308c\u3070\u81ea\u52d5\u3067\u4f5c\u6210\u3055\u308c\u305f\u65b0\u3057\u3044\u30c1\u30e3\u30f3\u30cd\u30eb\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u304f\u308c\u307e\u3059\u3002\r\n<p>\u3000\u3055\u3042\u4f7f\u3044\u305f\u304f\u306a\u308a\u307e\u3057\u305f\u304b\u3002", "name": "None", "password": ""}}, "bbd1": {}, "bbs3": {}, "_default": {"1": {"kinds": "conf", "title": "pybbs", "mentenance": false, "title2": "<h1 style=color:gray;text-align:center>pybbs</h1>", "bad_words": ["<style", "<link", "<script", "<img"], "password": "admin", "count": 30, "out_words": ["\u6b7b\u306d", "\u963f\u5446", "\u30a2\u30db", "\u99ac\u9e7f", "\u30d0\u30ab"]}}, "bbs1": {"1": {"date": "2016/11/21 19:24", "title": "bbs1", "number": 1, "comment": "<p>1<br></p>", "name": "\u8ab0\u304b\u3055\u3093", "password": "admin"}, "2": {"date": "2016/11/21 19:24", "title": "bbs1", "number": 2, "comment": "<p>2<br></p>", "name": "\u8ab0\u304b\u3055\u3093", "password": "admin"}, "3": {"date": "2016/11/21 19:24", "title": "bbs1", "number": 3, "comment": "<p>3<br></p>", "name": "\u8ab0\u304b\u3055\u3093", "password": "admin"}, "4": {"date": "2016/11/21 19:24", "title": "bbs1", "number": 4, "comment": "<p>4<br></p>", "name": "\u8ab0\u304b\u3055\u3093", "password": "admin"}, "5": {"date": "2016/11/21 19:24", "title": "bbs1", "number": 5, "comment": "<p>5<br></p>", "name": "\u8ab0\u304b\u3055\u3093", "password": "admin"}, "6": {"date": "2016/11/21 19:24", "title": "bbs1", "number": 6, "comment": "<p>6<br></p>", "name": "\u8ab0\u304b\u3055\u3093", "password": "admin"}, "7": {"date": "2016/11/21 19:24", "title": "bbs1", "number": 7, "comment": "<p>7<br></p>", "name": "\u8ab0\u304b\u3055\u3093", "password": "admin"}, "8": {"date": "2016/11/21 19:24", "title": "bbs1", "number": 8, "comment": "<p>8<br></p>", "name": "\u8ab0\u304b\u3055\u3093", "password": "admin"}, "9": {"date": "2016/11/21 19:25", "title": "bbs1", "number": 9, "comment": "<p>9<br></p>", "name": "\u8ab0\u304b\u3055\u3093", "password": "admin"}, "10": {"date": "2016/11/21 19:25", "title": "bbs1", "number": 10, "comment": "<p>10<br></p>", "name": "\u8ab0\u304b\u3055\u3093", "password": "admin"}, "11": {"date": "2016/11/21 19:38", "title": "bbs1", "number": 11, "comment": "<p>test<br></p>", "name": "\u8ab0\u304b\u3055\u3093", "password": "admin"}, "12": {"date": "2016/11/21 19:41", "title": "bbs1", "number": 12, "comment": "<p>1<br></p>", "name": "1", "password": "admin"}, "13": {"date": "2016/11/22 17:02", "title": "bbs1", "number": 13, "comment": "test \r\n\r\nit \r\n\r\nsi not same", "name": "1", "password": "admin"}, "14": {"date": "2016/11/22 18:26", "title": "bbs1", "number": 14, "comment": "test", "name": "1", "password": "admin"}, "15": {"date": "2016/11/22 18:32", "title": "bbs1", "number": 15, "comment": "t s t", "name": "1", "password": "admin"}}}
\ No newline at end of file
+{"bbs3": {}, "bbs1": {}, "_default": {"1": {"kinds": "conf", "title": "pybbs", "out_words": ["\u6b7b\u306d", "\u963f\u5446", "\u30a2\u30db", "\u99ac\u9e7f", "\u30d0\u30ab"], "mentenance": false, "title2": "<h1 style=color:gray;text-align:center>pybbs</h1>", "count": 30, "bad_words": ["<style", "<link", "<script", "<img"], "password": "admin"}}, "bbs": {"1": {"title": "\u3053\u306eBBS\u306f\u3059\u3054\u3044\u3067\u3059\u3002\u3002\u3002\uff20\uff20\uff1b", "comment": "<p>\u3053\u306e\u63b2\u793a\u677f\u306f\u3059\u3054\u3044\u3067\u3059\u3002\u4f55\u304c\u3059\u3054\u3044\u306e\u304b\u5229\u7528\u8005\u306b\u306f\u308f\u304b\u3089\u306a\u3044\u3067\u3057\u3087\u3046\u3051\u308c\u3069\u3001\u7ba1\u7406\u8005\u306f\u7ba1\u7406\u304c\u3057\u3084\u3059\u3044\u3067\u3059\u3002\u7c21\u5358\u306b\u904b\u7528\u3067\u304d\u307e\u3059\u3002heroku\u3067git\u3059\u308c\u3070\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u30af\u30ea\u30a2\u3057\u3066\u3059\u3050\u4f7f\u3048\u308b\u72b6\u614b\u306b\u306a\u308a\u307e\u3059\u3002\u6c17\u306b\u3057\u306a\u3044\u4eba\u306f\u305d\u306e\u307e\u307e\u4f7f\u3048\u307e\u3059\u3002\r\n<br></p><p>\u3000tornado\u3092\u4f7f\u7528\u3057\u3066\u66f8\u304b\u308c\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304c\u5927\u5909\u7c21\u7d20\u3067\u3059\u3002\u306a\u304a\u304b\u3064\u30d6\u30ed\u30b0\u30b7\u30b9\u30c6\u30e0\u306b\u30a2\u30c3\u30d7\u304c\u30b0\u30ec\u30fc\u30c9\u3055\u305b\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002\r\n<br></p><p>\u3000\u63b2\u793a\u677f\u306e\u7ba1\u7406\u306b\u5fc5\u8981\u306a\u62e1\u5f35\u3067\u3059\u304c\u30c1\u30e3\u30f3\u30cd\u30eb\u306e\u8ffd\u52a0\u306f\u7ba1\u7406\u8005\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u8ffd\u52a0\u3057\u305f\u3044URL\u3092\u6253\u3061\u8fbc\u3080\u3060\u3051\u3002\u305d\u3046\u3059\u308c\u3070\u81ea\u52d5\u3067\u4f5c\u6210\u3055\u308c\u305f\u65b0\u3057\u3044\u30c1\u30e3\u30f3\u30cd\u30eb\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u304f\u308c\u307e\u3059\u3002\r\n<br></p><p>\u3000\u3055\u3042\u4f7f\u3044\u305f\u304f\u306a\u308a\u307e\u3057\u305f\u304b\u3002<br></p>", "raw": "\u3053\u306e\u63b2\u793a\u677f\u306f\u3059\u3054\u3044\u3067\u3059\u3002\u4f55\u304c\u3059\u3054\u3044\u306e\u304b\u5229\u7528\u8005\u306b\u306f\u308f\u304b\u3089\u306a\u3044\u3067\u3057\u3087\u3046\u3051\u308c\u3069\u3001\u7ba1\u7406\u8005\u306f\u7ba1\u7406\u304c\u3057\u3084\u3059\u3044\u3067\u3059\u3002\u7c21\u5358\u306b\u904b\u7528\u3067\u304d\u307e\u3059\u3002heroku\u3067git\u3059\u308c\u3070\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u30af\u30ea\u30a2\u3057\u3066\u3059\u3050\u4f7f\u3048\u308b\u72b6\u614b\u306b\u306a\u308a\u307e\u3059\u3002\u6c17\u306b\u3057\u306a\u3044\u4eba\u306f\u305d\u306e\u307e\u307e\u4f7f\u3048\u307e\u3059\u3002\r\n\u3000tornado\u3092\u4f7f\u7528\u3057\u3066\u66f8\u304b\u308c\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304c\u5927\u5909\u7c21\u7d20\u3067\u3059\u3002\u306a\u304a\u304b\u3064\u30d6\u30ed\u30b0\u30b7\u30b9\u30c6\u30e0\u306b\u30a2\u30c3\u30d7\u304c\u30b0\u30ec\u30fc\u30c9\u3055\u305b\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002\r\n\u3000\u63b2\u793a\u677f\u306e\u7ba1\u7406\u306b\u5fc5\u8981\u306a\u62e1\u5f35\u3067\u3059\u304c\u30c1\u30e3\u30f3\u30cd\u30eb\u306e\u8ffd\u52a0\u306f\u7ba1\u7406\u8005\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u8ffd\u52a0\u3057\u305f\u3044URL\u3092\u6253\u3061\u8fbc\u3080\u3060\u3051\u3002\u305d\u3046\u3059\u308c\u3070\u81ea\u52d5\u3067\u4f5c\u6210\u3055\u308c\u305f\u65b0\u3057\u3044\u30c1\u30e3\u30f3\u30cd\u30eb\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u304f\u308c\u307e\u3059\u3002\r\n\u3000\u3055\u3042\u4f7f\u3044\u305f\u304f\u306a\u308a\u307e\u3057\u305f\u304b\u3002", "date": "2016/11/22 19:43", "name": "\u7ba1\u7406\u8005", "number": 1, "password": "admin"}}, "bbs2": {}}
\ No newline at end of file