mirror of
https://github.com/Tygs/0bin.git
synced 2023-08-10 21:13:00 +03:00
Python code passed linter
This commit is contained in:
parent
2b2ab65b73
commit
53a7b886fe
@ -40,4 +40,3 @@ MENU = (
|
||||
# browser
|
||||
MAX_SIZE = 1024 * 500
|
||||
MAX_SIZE_KB = int(math.ceil(MAX_SIZE / 1024.0))
|
||||
|
||||
|
@ -158,7 +158,7 @@ class Paste(object):
|
||||
f.write(unicode(self.expiration) + '\n')
|
||||
f.write(self.content + '\n')
|
||||
if self.comments:
|
||||
f.write(comments)
|
||||
f.write(self.comments)
|
||||
|
||||
return self
|
||||
|
||||
|
@ -1,9 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import time
|
||||
import sys
|
||||
import os
|
||||
import settings
|
||||
import glob
|
||||
import tempfile
|
||||
|
||||
|
12
start.py
12
start.py
@ -9,9 +9,7 @@
|
||||
|
||||
import sys
|
||||
import os
|
||||
import hashlib
|
||||
import thread
|
||||
import math
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
@ -22,8 +20,7 @@ sys.path.insert(0, os.path.dirname(settings.ROOT_DIR))
|
||||
sys.path.append(os.path.join(settings.ROOT_DIR, 'libs'))
|
||||
|
||||
import bottle
|
||||
from bottle import (Bottle, route, run, abort, error,
|
||||
static_file, debug, view, request)
|
||||
from bottle import (Bottle, run, static_file, view, request)
|
||||
|
||||
import clize
|
||||
|
||||
@ -38,6 +35,7 @@ global_vars = {
|
||||
'settings': settings
|
||||
}
|
||||
|
||||
|
||||
@app.route('/')
|
||||
@view('home')
|
||||
def index():
|
||||
@ -75,7 +73,6 @@ def create_paste():
|
||||
@view('paste')
|
||||
def display_paste(paste_id):
|
||||
|
||||
|
||||
now = datetime.now()
|
||||
keep_alive = False
|
||||
try:
|
||||
@ -106,11 +103,13 @@ def display_paste(paste_id):
|
||||
context = {'paste': paste, 'keep_alive': keep_alive}
|
||||
return dmerge(context, global_vars)
|
||||
|
||||
|
||||
@app.error(404)
|
||||
@view('404')
|
||||
def error404(code):
|
||||
return global_vars
|
||||
|
||||
|
||||
@clize.clize
|
||||
def runserver(host=settings.HOST, port=settings.PORT, debug=settings.DEBUG,
|
||||
serve_static=settings.DEBUG, user=settings.USER,
|
||||
@ -131,8 +130,5 @@ def runserver(host=settings.HOST, port=settings.PORT, debug=settings.DEBUG,
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
clize.run(runserver)
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*global sjcl:true, jQuery:true, $:true, lzw:true, zerobin:true, ZeroClipboard:true, vizhash:true, prettyPrint:true */
|
||||
/*global sjcl:true, jQuery:true, $:true, lzw:true, zerobin:true, ZeroClipboard:true, vizhash:true, prettyPrint:true, confirm:true */
|
||||
;(function(){
|
||||
"use strict";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user