1
0
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:
sam 2012-05-12 10:33:01 +02:00
parent 2b2ab65b73
commit 53a7b886fe
6 changed files with 18 additions and 25 deletions

View File

@ -40,4 +40,3 @@ MENU = (
# browser
MAX_SIZE = 1024 * 500
MAX_SIZE_KB = int(math.ceil(MAX_SIZE / 1024.0))

View File

@ -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

View File

@ -1,9 +1,7 @@
# -*- coding: utf-8 -*-
import time
import sys
import os
import settings
import glob
import tempfile

View File

@ -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)

View File

@ -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";