code
stringlengths
1
1.72M
language
stringclasses
1 value
import re def cleanjs(text): text = re.sub('\s*}\s*','\n}\n',text) text = re.sub('\s*{\s*',' {\n',text) text = re.sub('\s*;\s*',';\n',text) text = re.sub('\s*,\s*',', ',text) text = re.sub('\s*(?P<a>[\+\-\*/\=]+)\s*',' \g<a> ',text) lines = text.split('\n') text='' indent=0 for line...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Usage: Install cx_Freeze: http://cx-freeze.sourceforge.net/ Copy script to the web2py directory c:\Python27\python standalone_exe_cxfreeze.py build_exe """ from cx_Freeze import setup, Executable from gluon.import_all import base_modules, contributed_module...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- import cStringIO import re import sys import tarfile import urllib import xml.parsers.expat as expat """ Update script for contenttype.py module. Usage: python contentupdate.py /path/to/contenttype.py If no path is specified, script will look for contenttype.py in curre...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import time import stat import datetime from gluon.utils import md5_hash from gluon.restricted import RestrictedError from gluon.tools import Mail path = os.path.join(request.folder, 'errors') hashes = {} mail = Mail() ### CONFIGURE HERE SLEEP_MINU...
Python
import sys, glob def read_fileb(filename, mode='rb'): f = open(filename, mode) try: return f.read() finally: f.close() def write_fileb(filename, value, mode='wb'): f = open(filename, mode) try: f.write(value) finally: f.close() for filename in glob.glob(sys.arg...
Python
import os,sys from collections import deque import string import argparse import cStringIO,operator import cPickle as pickle from collections import deque import math import re import cmd import readline try: ...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ crontab -e * 3 * * * root path/to/this/file """ USER = 'www-data' TMPFILENAME = 'web2py_src_update.zip' import sys import os import urllib import zipfile if len(sys.argv)>1 and sys.argv[1] == 'nightly': ve...
Python
#!/usr/bin/python # -*- coding: utf-8 -*- # routers are dictionaries of URL routing parameters. # # For each request, the effective router is: # the built-in default base router (shown below), # updated by the BASE router in routes.py routers, # updated by the app-specific router in routes.py routers (if an...
Python
#!/usr/bin/env python import gluon from gluon.fileutils import untar import os import sys def main(): path = gluon.__path__ out_path = os.getcwd() try: if sys.argv[1] and os.path.exists(sys.argv[1]):# To untar the web2py env to the selected path out_path = sys.argv[1] else: ...
Python
EXPIRATION_MINUTES=60 DIGITS=('0','1','2','3','4','5','6','7','8','9') import os, time, stat, cPickle, logging path=os.path.join(request.folder,'sessions') if not os.path.exists(path): os.mkdir(path) now=time.time() for filename in os.listdir(path): fullpath=os.path.join(path,filename) if os.path.isfile(ful...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Update" ist ein optionaler Ausdruck wie "Feld1 = \'newvalue". JOIN Ergebnisse können nicht aktualisiert oder gelöscht werden', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Uaktualnij" jest dodatkowym wyrażeniem postaci "pole1=\'nowawartość\'". Nie możesz uaktualnić lub usunąć wyników z JOIN:', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"actualice" es una expresión opcional como "campo1=\'nuevo_valor\'". No se puede actualizar o eliminar resultados de un JOIN', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" è un\'espressione opzionale come "campo1=\'nuovo valore\'". Non si può fare "update" o "delete" dei risultati di un JOIN ', '%Y-%m-%d': '%d/%m/%Y', '%Y-%m-%d %H:%M:%S': '%d/%m/%...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Update" ist ein optionaler Ausdruck wie "Feld1 = \'newvalue". JOIN Ergebnisse können nicht aktualisiert oder gelöscht werden', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', '%s r...
Python
# coding: utf8 { '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', '%Y-%m-%d': '%Y-%m-%d', '(requires internet access)': '(インターネットアクセスが必要)', '(something like "it-it")': '(例: "it-it")', 'Abort': '中断', 'About application': 'アプリケーションについて', 'About': 'About', 'Additional code for your application': 'アプリケーションに必要な追加記述', 'Ad...
Python
# coding: utf8 { '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', '(requires internet access)': '(vereis internet toegang)', '(something like "it-it")': '(iets soos "it-it")', 'About': 'Oor', 'About application': 'Oor program', 'Additional code for your application': 'Additionele kode vir u application...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Uaktualnij" jest dodatkowym wyrażeniem postaci "pole1=\'nowawartość\'". Nie możesz uaktualnić lub usunąć wyników z JOIN:', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" è un\'espressione opzionale come "campo1=\'nuovo valore\'". Non si può fare "update" o "delete" dei risultati di un JOIN ', '%Y-%m-%d': '%d/%m/%Y', '%Y-%m-%d %H:%M:%S': '%d/%m/%...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" est une expression en option tels que "field1 = \'newvalue\'". Vous ne pouvez pas mettre à jour ou supprimer les résultats d\'une jointure "a JOIN"', '%Y-%m-%d': '%d-%m-%Y', '%Y...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Popravi" je izbirni izraz kot npr.: "stolpec1 = \'novavrednost\'". Rezultatov JOIN operacije ne morete popravljati ali brisati', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"עדכן" הוא ביטוי אופציונאלי, כגון "field1=newvalue". אינך יוכל להשתמש בjoin, בעת שימוש ב"עדכן" או "מחק".', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', '%s rows dele...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" é uma expressão opcional como "campo1=\'novo_valor\'". Não é permitido atualizar ou apagar resultados de um JOIN', '%Y-%m-%d': '%d/%m/%Y', '%Y-%m-%d %H:%M:%S': '%d/%m/%Y %H:%M:%...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"更新" 是選擇性的條件式, 格式就像 "欄位1=\'值\'". 但是 JOIN 的資料不可以使用 update 或是 delete"', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', '%s rows deleted': '已刪除 %s 筆', '%s rows updated': ...
Python
# coding: utf8 { '"browse"': '游览', '"save"': '"保存"', '"submit"': '"提交"', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"更新"是可配置项 如 "field1=\'newvalue\'",你无法在JOIN 中更新或删除', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', '%s rows del...
Python
# ########################################################### # ## generate menu # ########################################################### _a = request.application _c = request.controller _f = request.function response.title = '%s %s' % (_f, '/'.join(request.args)) response.subtitle = 'admin' response.menu = [(T('...
Python
response.files.append(URL('static','plugin_multiselect/jquery.dimensions.js')) response.files.append(URL('static','plugin_multiselect/jquery.multiselect.js')) response.files.append(URL('static','plugin_multiselect/jquery.multiselect.css')) response.files.append(URL('static','plugin_multiselect/start.js'))
Python
EXPIRATION = 60 * 60 # logout after 60 minutes of inactivity CHECK_VERSION = True WEB2PY_URL = 'http://web2py.com' WEB2PY_VERSION_URL = WEB2PY_URL+'/examples/default/version' ########################################################################### # Preferences for EditArea # the user-interface feature that allows...
Python
import base64, os, time from gluon import portalocker from gluon.admin import apath from gluon.fileutils import read_file # ########################################################### # ## make sure administrator is on localhost or https # ########################################################### http_host = request...
Python
# Template helpers import os def A_button(*a,**b): b['_data-role'] = 'button' b['_data-inline'] = 'true' return A(*a,**b) def button(href, label): if request.user_agent().is_mobile: ret = A_button(SPAN(label), _href=href) else: ret = A(SPAN(label),_class='button',_href=href) r...
Python
# -*- coding: utf-8 -*- # this file is released under public domain and you can use without limitations if MULTI_USER_MODE: db = DAL('sqlite://storage.sqlite') # if not, use SQLite or other DB from gluon.tools import * mail = Mail() # mailer auth = Auth(globals(),...
Python
import time import os import sys import re import urllib import cgi import difflib import shutil import stat import socket from textwrap import dedent try: from mercurial import ui, hg, cmdutil, scmutil have_mercurial = True except ImportError: have_mercurial = False from gluon.utils import md5_hash from...
Python
from gluon.fileutils import read_file, write_file if DEMO_MODE or MULTI_USER_MODE: session.flash = T('disabled in demo mode') redirect(URL('default','site')) if not have_mercurial: session.flash=T("Sorry, could not find mercurial installed") redirect(URL('default','design',args=request.args(0))) _hgig...
Python
import os import sys import cStringIO import gluon.contrib.shell import gluon.dal import gluon.html import gluon.validators import code, thread from gluon.debug import communicate, web_debugger, qdb_debugger import pydoc if DEMO_MODE or MULTI_USER_MODE: session.flash = T('disabled in demo mode') redirect(URL(...
Python
from gluon.admin import * from gluon.fileutils import abspath, read_file, write_file from gluon.tools import Service from glob import glob import shutil import platform import time import base64 import os try: from cStringIO import StringIO except ImportError: from StringIO import StringIO service = Service(g...
Python
# -*- coding: utf-8 -*- # ########################################################## # ## make sure administrator is on localhost # ########################################################### import os import socket import datetime import copy import gluon.contenttype import gluon.fileutils # ## critical --- make a ...
Python
import sys import cStringIO import gluon.contrib.shell import code, thread from gluon.shell import env if DEMO_MODE or MULTI_USER_MODE: session.flash = T('disabled in demo mode') redirect(URL('default','site')) FE=10**9 def index(): app = request.args(0) or 'admin' reset() return dict(app=app) d...
Python
### this works on linux only import re try: import fcntl import subprocess import signal import os import shutil from gluon.fileutils import read_file, write_file except: session.flash='sorry, only on Unix systems' redirect(URL(request.application,'default','site')) forever=10**8 def ...
Python
import os from gluon.settings import global_settings, read_file # def index(): app = request.args(0) return dict(app=app) def profiler(): """ to use the profiler start web2py with -F profiler.log """ KEY = 'web2py_profiler_size' filename = global_settings.cmd_options.profiler_filename ...
Python
# coding: utf8 EXPERIMENTAL_STUFF = True if EXPERIMENTAL_STUFF: is_mobile = request.user_agent().is_mobile if is_mobile: response.view = response.view.replace('default/','default.mobile/') response.menu = [] from gluon.admin import * from gluon.fileutils import abspath, read_file, write_file ...
Python
response.files=response.files[:3] response.menu=[] def index(): return locals() def about(): return locals()
Python
# -*- coding: utf-8 -*- import os, uuid, re, pickle, urllib, glob from gluon.admin import app_create, plugin_install from gluon.fileutils import abspath, read_file, write_file def reset(session): session.app={ 'name':'', 'params':[('title','My New App'), ('subtitle','powered by w...
Python
# -*- coding: utf-8 -*- response.menu = [ (T('Home'),False,URL('default','index')), (T('About'),False,URL('default','what')), (T('Download'),False,URL('default','download')), (T('Docs & Resources'),False,URL('default','documentation')), (T('Support'),False,URL('default','support')), (T('Contrib...
Python
######################################################################### ## This scaffolding model makes your app work on Google App Engine too ######################################################################### if request.controller.endswith('_examples'): response.generic_patterns.append('*') from gluon.setti...
Python
def group_feed_reader(group,mode='div',counter='5'): """parse group feeds""" url = "http://groups.google.com/group/%s/feed/rss_v2_0_topics.xml?num=%s" %\ (group,counter) from gluon.contrib import feedparser g = feedparser.parse(url) if mode == 'div': html = XML(TAG.BLOCKQUOTE(UL...
Python
import gluon.template markmin_dict = dict( code_python=lambda code: str(CODE(code)), template=lambda \ code:gluon.template.render(code,context=globals()), sup=lambda \ code:'<sup style="font-size:0.5em;">%s</sup>'%code, br=lambda n:'<br>'*int(n), groupdates=lambda group:group_feed_r...
Python
import random quotes = [ ("web2py was the life saver today for me, my blog post: Standalone Usage of web2py's", "caglartoklu", "http://twitter.com/#!/caglartoklu/status/84292131707031553"), ("Get Things Done - Faster, Better and More Easily with web2py", "Bruno Rocha", "http://twitter.com/#!/r...
Python
######################################################################### ## This scaffolding model makes your app work on Google App Engine too ######################################################################### if request.controller.endswith('_examples'): response.generic_patterns.append('*') from gluon.setti...
Python
def hello1(): """ simple page without template """ return 'Hello World' def hello2(): """ simple page without template but with internationalization """ return T('Hello World') def hello3(): """ page rendered by template simple_examples/index3.html or generic.html""" return dict(message='...
Python
def index(): return dict() def data(): if not session.m or len(session.m) == 10: session.m = [] if request.vars.q: session.m.append(request.vars.q) session.m.sort() return TABLE(*[TR(v) for v in session.m]).xml() def flash(): response.flash = 'this text should appear!' re...
Python
def variables(): return dict(a=10, b=20) def test_for(): return dict() def test_if(): return dict() def test_try(): return dict() def test_def(): return dict() def escape(): return dict(message='<h1>text is scaped</h1>') def xml(): return dict(message=XML('<h1>text is not esca...
Python
def form(): """ a simple entry form with various types of objects """ form = FORM(TABLE( TR('Your name:', INPUT(_type='text', _name='name', requires=IS_NOT_EMPTY())), TR('Your email:', INPUT(_type='text', _name='email', requires=IS_EMAIL())), TR('Admin', INPUT(_...
Python
# -*- coding: utf-8 -*- # ########################################################## # ## make sure administrator is on localhost # ########################################################### import os import socket import datetime import copy import gluon.contenttype import gluon.fileutils # ## critical --- make a ...
Python
def counter(): """ every time you reload, it increases the session.counter """ if not session.counter: session.counter = 0 session.counter += 1 return dict(counter=session.counter)
Python
from gluon.fileutils import read_file response.menu = [['Register Person', False, URL('register_person')], ['Register Dog', False, URL('register_dog')], ['Register Product', False, URL('register_product')], ['Buy product', False, URL('buy')]] def register_person(): ...
Python
# -*- coding: utf-8 -*- from gluon.fileutils import read_file response.title = T('web2py Web Framework') response.keywords = T('web2py, Python, Web Framework') response.description = T('web2py Web Framework') session.forget() cache_expire = not request.is_local and 300 or 0 @cache('index', time_expire=cache_expire)...
Python
def civilized(): response.menu = [['civilized', True, URL('civilized' )], ['slick', False, URL('slick')], ['basic', False, URL('basic')]] response.flash = 'you clicked on civilized' return dict(message='you clicked on civilized') def slick(): response.menu = [...
Python
session.forget() response.menu = [['home', False, '/%s/default/index' % request.application], ['docs', True, '/%s/global/vars' % request.application]] def vars(): """the running controller function!""" if not request.args: ( doc, keys, ...
Python
import time def cache_in_ram(): """cache the output of the lambda function in ram""" t = cache.ram('time', lambda : time.ctime(), time_expire=5) return dict(time=t, link=A('click to reload', _href=URL(r=request))) def cache_on_disk(): """cache the output of the lambda function on disk""" t = ...
Python
from gluon.contrib.spreadsheet import Sheet def callback(): return cache.ram('sheet1',lambda:None,None).process(request) def index(): sheet = cache.ram('sheet1',lambda:Sheet(10,10,URL('callback')),0) #sheet.cell('r0c3',value='=r0c0+r0c1+r0c2',readonly=True) return dict(sheet=sheet)
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', '%s r...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Uaktualnij" jest dodatkowym wyra\xc5\xbceniem postaci "pole1=\'nowawarto\xc5\x9b\xc4\x87\'". Nie mo\xc5\xbcesz uaktualni\xc4\x87 lub usun\xc4\x85\xc4\x87 wynik\xc3\xb3w z JOIN:', '%Y-%m...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"actualice" es una expresión opcional como "campo1=\'nuevo_valor\'". No se puede actualizar o eliminar resultados de un JOIN', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" è un\'espressione opzionale come "campo1=\'nuovo valore\'". Non si può fare "update" o "delete" dei risultati di un JOIN ', '%Y-%m-%d': '%d/%m/%Y', '%Y-%m-%d %H:%M:%S': '%d/%m/%...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Изменить" - необязательное выражение вида "field1=\'новое значение\'". Результаты операции JOIN нельзя изменить или удалить.', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Uaktualnij" jest dodatkowym wyra\xc5\xbceniem postaci "pole1=\'nowawarto\xc5\x9b\xc4\x87\'". Nie mo\xc5\xbcesz uaktualni\xc4\x87 lub usun\xc4\x85\xc4\x87 wynik\xc3\xb3w z JOIN:', '%Y-%m...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" è un\'espressione opzionale come "campo1=\'nuovo valore\'". Non si può fare "update" o "delete" dei risultati di un JOIN ', '%Y-%m-%d': '%d/%m/%Y', '%Y-%m-%d %H:%M:%S': '%d/%m/%...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" est une expression optionnelle comme "champ1=\'nouvellevaleur\'". Vous ne pouvez mettre à jour ou supprimer les résultats d\'un JOIN', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" é uma expressão opcional como "field1=\'newvalue\'". Não pode actualizar ou eliminar os resultados de um JOIN', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S',...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN', '%Y-%m-%d': '%Y.%m.%d.', '%Y-%m-%d %H:%M:%S': '%Y.%m.%d. %H:%M:%S', '%s...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" é uma expressão opcional como "campo1=\'novovalor\'". Você não pode atualizar ou apagar os resultados de um JOIN', '%Y-%m-%d': '%d-%m-%Y', '%Y-%m-%d %H:%M:%S': '%d-%m-%Y %H:%M:%...
Python
# cs-cz.py pro web2py # coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" je voliteľný výraz ako "field1=\'newvalue\'". Nemôžete upravovať alebo zmazať výsledky JOINu', '%Y-%m-%d': '%d.%m.%Y', '%Y-%m-%d %H:%M:%S': '%d.%m.%Y %H:%M...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" est une expression optionnelle comme "champ1=\'nouvellevaleur\'". Vous ne pouvez mettre à jour ou supprimer les résultats d\'un JOIN', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"更新" 是選擇性的條件式, 格式就像 "欄位1=\'值\'". 但是 JOIN 的資料不可以使用 update 或是 delete"', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', '%s rows deleted': '已刪除 %s 筆', '%s rows updated': ...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" é uma expressão opcional como "field1=\'newvalue\'". Não pode actualizar ou eliminar os resultados de um JOIN', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S',...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN', '%Y-%m-%d': '%Y.%m.%d.', '%Y-%m-%d %H:%M:%S': '%Y.%m.%d. %H:%M:%S', '%s...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" je voliteľný výraz ako "field1=\'newvalue\'". Nemôžete upravovať alebo zmazať výsledky JOINu', '%Y-%m-%d': '%d.%m.%Y', '%Y-%m-%d %H:%M:%S': '%d.%m.%Y %H:%M:%S', '%s rows deleted...
Python
# -*- coding: utf-8 -*- # this file is released under public domain and you can use without limitations ######################################################################### ## Customize your APP title, subtitle and menus here ######################################################################### response.titl...
Python
# -*- coding: utf-8 -*- ######################################################################### ## This scaffolding model makes your app work on Google App Engine too ## File is released under public domain and you can use without limitations ######################################################################### ...
Python
# -*- coding: utf-8 -*- # ########################################################## # ## make sure administrator is on localhost # ########################################################### import os import socket import datetime import copy import gluon.contenttype import gluon.fileutils # ## critical --- make a ...
Python
# -*- coding: utf-8 -*- # this file is released under public domain and you can use without limitations ######################################################################### ## This is a samples controller ## - index is the default action of any application ## - user is required for authentication and authorizatio...
Python
#!/usr/bin/env python from distutils.core import setup from gluon.fileutils import tar, untar, read_file, write_file import tarfile import sys def tar(file, filelist, expression='^.+$'): """ tars dir/files into file, only tars file that match expression """ tar = tarfile.TarFile(file, 'w') try: ...
Python
def webapp_add_wsgi_middleware(app): from google.appengine.ext.appstats import recording app = recording.appstats_wsgi_middleware(app) return app
Python
""" web2py handler for isapi-wsgi for IIS. Requires: http://code.google.com/p/isapi-wsgi/ """ # The entry point for the ISAPI extension. def __ExtensionFactory__(): import os import sys path = os.path.dirname(os.path.abspath(__file__)) os.chdir(path) sys.path = [path]+[p for p in sys.path if not p==...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This file is part of the web2py Web Framework Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) This is a CGI handler for Apache Requires apache+[mod_cgi or mod_cgid]. In httpd.conf put something like: ...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- # Sropulpof # Copyright (C) 2008 Société des arts technologiques (SAT) # http://www.sat.qc.ca # All rights reserved. # # This file is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Soft...
Python
"""Convert a FAQ (AlterEgo) markdown dump into ReSt documents using pandoc **Todo** #. add titles #. add logging #. add CLI with optparse """ import os import sys import glob import subprocess import logging indir = 'faq_markdown' outdir = 'faq_rst' inpath = os.path.join('.', indir) outpath = os.path.join('.', out...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- # Sropulpof # Copyright (C) 2008 Société des arts technologiques (SAT) # http://www.sat.qc.ca # All rights reserved. # # This file is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Soft...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- # Sropulpof # Copyright (C) 2008 Société des arts technologiques (SAT) # http://www.sat.qc.ca # All rights reserved. # # This file is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Soft...
Python
import os import subprocess import codecs #--- BZR: changelog information def write_changelog_bzr(repo_path, output_dir, output_file='bzr_revision_log.txt', target_encoding='utf-8'): """Write the bzr changelog to a file whi...
Python
""" A special directive for generating a matplotlib plot. .. warning:: This is a hacked version of plot_directive.py from Matplotlib. It's very much subject to change! Usage ----- Can be used like this:: .. plot:: examples/example.py .. plot:: import matplotlib.pyplot as plt plt.plot(...
Python
"""Extract reference documentation from the NumPy source tree. """ import inspect import textwrap import re import pydoc from StringIO import StringIO from warnings import warn 4 class Reader(object): """A line-based string reader. """ def __init__(self, data): """ Parameters ----...
Python
# # A pair of directives for inserting content that will only appear in # either html or latex. # from docutils.nodes import Body, Element from docutils.writers.html4css1 import HTMLTranslator try: from sphinx.latexwriter import LaTeXTranslator except ImportError: from sphinx.writers.latex import LaTeXTranslat...
Python
from cStringIO import StringIO import compiler import inspect import textwrap import tokenize from compiler_unparse import unparse class Comment(object): """ A comment block. """ is_comment = True def __init__(self, start_lineno, end_lineno, text): # int : The first line number in the block. ...
Python
""" =========== autosummary =========== Sphinx extension that adds an autosummary:: directive, which can be used to generate function/method/attribute/etc. summary lists, similar to those output eg. by Epydoc and other API doc generation tools. An :autolink: role is also provided. autosummary directive -------------...
Python
#!/usr/bin/env python r""" autosummary_generate.py OPTIONS FILES Generate automatic RST source files for items referred to in autosummary:: directives. Each generated RST file contains a single auto*:: directive which extracts the docstring of the referred item. Example Makefile rule:: generate: ./e...
Python
from distutils.core import setup import setuptools import sys, os version = "0.2.dev" setup( name="numpydoc", packages=["numpydoc"], package_dir={"numpydoc": ""}, version=version, description="Sphinx extension to support docstrings in Numpy format", # classifiers from http://pypi.python.org/py...
Python
""" Turn compiler.ast structures back into executable python code. The unparse method takes a compiler.ast tree and transforms it back into valid python code. It is incomplete and currently only works for import statements, function calls, function definitions, assignments, and basic expressions. ...
Python
""" ============== phantom_import ============== Sphinx extension to make directives from ``sphinx.ext.autodoc`` and similar extensions to use docstrings loaded from an XML file. This extension loads an XML file in the Pydocweb format [1] and creates a dummy module that contains the specified docstrings. This can be ...
Python