code
stringlengths
1
1.72M
language
stringclasses
1 value
#!/usr/bin/env python # -*- coding: utf8 -*- # Plural-Forms for tr (Turkish) nplurals=1 # Turkish language has ONE form! # Always returns 0: get_plural_id = lambda n: 0 # Construct and return plural form of *word* using # *plural_id* (which ALWAYS>0). This function will be executed # for words (or phrases) not foun...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- # Plural-Forms for lt (Lithuanian) nplurals=3 # Lithuanian language has 3 forms: # 1 singular and 2 plurals # Determine plural_id for number *n* as sequence of positive # integers: 0,1,... # NOTE! For singular form ALWAYS return plural_id = 0 get_plural_id = lam...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- # Plural-Forms for id (Indonesian) nplurals=2 # Indonesian language has 2 forms: # 1 singular and 1 plural # Determine plural_id for number *n* as sequence of positive # integers: 0,1,... # NOTE! For singular form ALWAYS return plural_id = 0 get_plural_id = la...
Python
""" Usage: in web2py models/db.py from gluon.contrib.heroku import get_db db = get_db() """ import os from gluon import * from gluon.dal import ADAPTERS, UseDatabaseStoredFile,PostgreSQLAdapter class HerokuPostgresAdapter(UseDatabaseStoredFile,PostgreSQLAdapter): drivers = ('psycopg2',) uploads_in_blob = Tru...
Python
# -*- coding: utf-8 -*- """ pbkdf2 ~~~~~~ This module implements pbkdf2 for Python. It also has some basic tests that ensure that it works. The implementation is straightforward and uses stdlib only stuff and can be easily be copy/pasted into your favourite application. Use this as repla...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- # This module provides a simple API for Paymentech(c) payments # The original code was taken from this web2py issue post # http://code.google.com/p/web2py/issues/detail?id=1170 by Adnan Smajlovic # # Copyright (C) <2012> Alan Etkin <spametki@gmail.com> # License: BS...
Python
# -*- coding: utf-8 -*- ####################################################################### # # Put this file in yourapp/modules/images.py # # Given the model # # db.define_table("table_name", Field("picture", "upload"), Field("thumbnail", "upload")) # # # to resize the picture on upload # # from images import RES...
Python
# -*- coding: utf-8 -*- """ Developed by Massimo Di Pierro, optional component of web2py, GPL2 license. """ import re import pickle import copy import simplejson def quote(text): return str(text).replace('\\', '\\\\').replace("'", "\\'") class Node: def __init__(self, name, value, url='.', readonly=False,...
Python
# pyuca - Unicode Collation Algorithm # Version: 2012-06-21 # # James Tauber # http://jtauber.com/ # Copyright (c) 2006-2012 James Tauber and contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # ...
Python
import os import pyuca unicode_collator = None def set_unicode_collator(file): global unicode_collator unicode_collator = pyuca.Collator(file) set_unicode_collator(os.path.join(os.path.dirname(__file__), 'allkeys.txt'))
Python
#!/usr/bin/python # # Copyright 2007 Google Inc. # Licensed to PSF under a Contributor Agreement. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICE...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- "FPDF for python (a.k.a. pyfpdf)" # Read more about this http://code.google.com/p/pyfpdf # Please note that new package name is fpdf (to avoid some naming conflicts) # import fpdf into pyfpdf for backward compatibility (prior web2py 2.0): from fpdf import * # import warni...
Python
# fix response import re import os import cPickle import gluon.serializers from gluon import current, HTTP from gluon.html import markmin_serializer, TAG, HTML, BODY, UL, XML, H1 from gluon.contenttype import contenttype from gluon.contrib.fpdf import FPDF, HTMLMixin from gluon.sanitizer import sanitize from gluon.con...
Python
import re import cPickle import random import datetime IUP = {'shoebill':{'a':1,'187':1},'trout-like':{'parr':1},'fig.':{'19':1},'mcintosh.':{'the':1,'illustration':1},'chiasmodon':{'niger':2},'yellow':{'and':4,'giant':1,'green':2,'red':1,'spots':1},'four':{'brightly':1,'hundred':1,'haunts':1,'feet':1,'solutions':2,'h...
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) Plural subsystem is created by Vladyslav Kozlovskyy (Ukraine) <dbdevelop@gma...
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) """ import sys import cPickle import traceback import types import os import logging from storage import S...
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) Web2Py framework modules ======================== """ __all__ = ['A', 'B', 'BEAUTIFY', 'BODY', 'BR', 'CAT'...
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) """ import sys import storage import os import re import tarfile import glob import time import datetime im...
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) Contains the classes for the global used variables: - Request - Response - Session """ from storage impo...
Python
""" 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) """ import datetime import decimal from storage import Storage from html import TAG, XmlComponent from html import xmlescape from languages import lazyT im...
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) """ import os import stat import time import re import errno import rewrite from http import HTTP from cont...
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) Functions required to execute app components ============================================ FOR INTERNAL USE...
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) """ import re import cgi __all__ = ['highlight'] class Highlighter(object): """ Do syntax highl...
Python
""" 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) Utility functions for the Admin application =========================================== """ import os import sys import traceback import zipfile import ur...
Python
#!/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) Thanks to ga2arch for help with IS_IN_DB and IS_NOT_IN_DB on GAE """ import os import re import datetime impor...
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) Holds: - SQLFORM: provide a form for a table (with/without record) - SQLTABLE: provides a table for a set ...
Python
#!/usr/bin/env python """ 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 file is not strictly required by web2py. It is used for three purposes: 1) check that all required modules are installed prop...
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) WSGI wrapper for mod_python. Requires Python 2.2 or greater. Part of CherryPy mut modified by Massimo Di Pi...
Python
import time import sys import urllib2 import urllib2 n = int(sys.argv[1]) url = sys.argv[2] headers = {"Accept-Language": "en"} req = urllib2.Request(url, None, headers) t0 = time.time() for k in xrange(n): data = urllib2.urlopen(req).read() print (time.time() - t0) / n if n == 1: print data
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- from datetime import datetime from time import mktime from time import sleep from time import time DB_URI = 'sqlite://sessions.sqlite' EXPIRATION_MINUTES = 60 SLEEP_MINUTES = 5 while 1: # Infinite loop now = time() # get current Unix timestamp for row in db()....
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ## launch with python web2py.py -S myapp -R scripts/zip_static_files.py import os import gzip def zip_static(filelist=[]): tsave = 0 for fi in filelist: extension = os.path.splitext(fi) extension = len(extension) > 1 and extension[1] or None ...
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, TicketStorage from gluon import DAL SLEEP_MINUTES = 5 errors_path = os.path.join(request.folder, 'errors') try: db_string = op...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' @author: Pierre Thibault (pierre.thibault1 -at- gmail.com) @license: MIT @since: 2011-06-17 Usage: dict_diff [OPTION]... dict1 dict2 Show the differences for two dictionaries. -h, --help Display this help message. dict1 and dict2 are two web2py dictionar...
Python
USAGE = """ from web2py main folder python scripts/make_min_web2py.py /path/to/minweb2py it will mkdir minweb2py and build a minimal web2py installation - no admin, no examples, one line welcome - no scripts - drops same rarely used contrib modules - more modules could be dropped but minimal difference """ # files to...
Python
import sys import glob import os import shutil name = sys.argv[1] app = sys.argv[2] dest = sys.argv[3] a = glob.glob( 'applications/%(app)s/*/plugin_%(name)s.*' % dict(app=app, name=name)) b = glob.glob( 'applications/%(app)s/*/plugin_%(name)s/*' % dict(app=app, name=name)) for f in a: print 'cp %s ...' % ...
Python
import glob import os import zipfile import sys import re from BeautifulSoup import BeautifulSoup as BS def head(styles): title = '<title>{{=response.title or request.application}}</title>' items = '\n'.join(["{{response.files.append(URL(request.application,'static','%s'))}}" % (style) for style in styles]) ...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ sessions2trash.py Run this script in a web2py environment shell e.g. python web2py.py -S app If models are loaded (-M option) auth.settings.expiration is assumed for sessions without an expiration. If models are not loaded, sessions older than 60 minutes are removed. U...
Python
import os import sys import glob sys.path.append(os.path.join(os.path.split(__file__)[0],'..')) from gluon.html import CODE def main(path): models = glob.glob(os.path.join(path,'models','*.py')) controllers = glob.glob(os.path.join(path,'controllers','*.py')) views = glob.glob(os.path.join(path,'views','*....
Python
#!/usr/bin/env python import sys, os, time, subprocess class Base: def run_command(self, *args): """ Returns the output of a command as a tuple (output, error). """ p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) return p.communicate() class Serv...
Python
from service import ServiceBase import os, sys, time, subprocess, atexit from signal import SIGTERM class LinuxService(ServiceBase): def __init__(self, name, label, stdout='/dev/null', stderr='/dev/null'): ServiceBase.__init__(self, name, label, stdout, stderr) self.pidfile = '/tmp/%s.pid' % name ...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- # TODO: Comment this code import sys import shutil import os from gluon.languages import findT sys.path.insert(0, '.') def sync_language(d, data): ''' this function makes sure a translated string will be prefered over an untranslated string when syncing languag...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- """Create web2py model (python code) to represent PostgreSQL tables. Features: * Uses ANSI Standard INFORMATION_SCHEMA (might work with other RDBMS) * Detects legacy "keyed" tables (not having an "id" PK) * Connects directly to running databases, no need to do a SQL dump...
Python
import sys import re def cleancss(text): text = re.compile('\s+').sub(' ', text) text = re.compile('\s*(?P<a>,|:)\s*').sub('\g<a> ', text) text = re.compile('\s*;\s*').sub(';\n ', text) text = re.compile('\s*\{\s*').sub(' {\n ', text) text = re.compile('\s*\}\s*').sub('\n}\n\n', text) re...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import re filename = sys.argv[1] datafile = open(filename, 'r') try: data = '\n' + datafile.read() finally: datafile.close() SPACE = '\n ' if '-n' in sys.argv[1:] else ' ' data = re.compile('(?<!\:)//(?P<a>.*)').sub('/* \g<a> */', data) data = re.c...
Python
''' Create the web2py code needed to access your mysql legacy db. To make this work all the legacy tables you want to access need to have an "id" field. This plugin needs: mysql mysqldump installed and globally available. Under Windows you will probably need to add the mysql executable directory to the PATH variable...
Python
# -*- coding: utf-8 -*- ''' autoroutes writes routes for you based on a simpler routing configuration file called routes.conf. Example: ----- BEGIN routes.conf------- 127.0.0.1 /examples/default domain1.com /app1/default domain2.com /app2/default domain3.com /app3/default ----- END ---------- It maps a domain (the ...
Python
# # This files allows to delegate authentication for every URL within a domain # to a web2py app within the same domain # If you are logged in the app, you have access to the URL # even if the URL is not a web2py URL # # in /etc/apache2/sites-available/default # # <VirtualHost *:80> # WSGIDaemonProcess web2py user=ww...
Python
# -*- coding: utf-8 -*- ''' Create the web2py model code needed to access your sqlite legacy db. Usage: python extract_sqlite_models.py Access your tables with: legacy_db(legacy_db.mytable.id>0).select() extract_sqlite_models.py -- Copyright (C) Michele Comitini This code is distributed with web2py. The regexp co...
Python
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 =...
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 import 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...
Python
import os import sys paths = [sys.argv[1]] paths1 = [] paths2 = [] while paths: path = paths.pop() for filename in os.listdir(path): fullname = os.path.join(path, filename) if os.path.isdir(fullname): paths.append(fullname) else: extension = filename.split('.')[-1...
Python
import os import sys from collections import deque import string import argparse import cStringIO import operator import cPickle as pickle from collections import deque import math import re import cmd import readline try: from gluon import DAL except ImportError as err: print('gluon path not found') class re...
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': version = 'http://web2py.com/examples/static/nightly/web2...
Python
import os import glob import zipfile import urllib import tempfile import shutil def copytree(src, dst): names = os.listdir(src) ignored_names = set() errors = [] if not os.path.exists(dst): os.makedirs(dst) for name in names: srcname = os.path.join(src, name) dstname = os.p...
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 any), # updated b...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys path = os.getcwd() try: if sys.argv[1] and os.path.exists(sys.argv[1]): path = sys.argv[1] except: pass os.chdir(path) sys.path = [path]+[p for p in sys.path if not p==path] # import gluon.import_all ##### This should be uncommented f...
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...
Python
# coding: utf8 { '!langcode!': 'zh-cn', '!langname!': '中文', '"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 %...
Python
# coding: utf8 { '!langcode!': 'it', '!langname!': 'Italiano', '"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 ', '%s %%{...
Python
# coding: utf8 { '!langcode!': 'sr-cr', '!langname!': 'Српски (Ћирилица)', '%Y-%m-%d': '%d-%m-%Y', '%Y-%m-%d %H:%M:%S': '%d-%m-%Y %H:%M:%S', '(requires internet access)': '(захтијева приступ интернету)', '(something like "it-it")': '(нешто као "it-it")', '@markmin\x01(file **gluon/contrib/plural_rules/%s.py** is not fo...
Python
# coding: utf8 { '!langcode!': 'es', '!langname!': 'Español', '"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', '%s %%{row} de...
Python
#!/usr/bin/env python { # "singular form (0)": ["first plural form (1)", "second plural form (2)", ...], 'файл': ['файла','файлов'], }
Python
#!/usr/bin/env python { # "singular form (0)": ["first plural form (1)", "second plural form (2)", ...], 'file': ['files'], }
Python
# coding: utf8 { '!langcode!': 'ja-jp', '!langname!': '日本語', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', '%s %%{row} deleted': '%s rows deleted', '%s %%{row} updated': '%s rows updated', '(requires internet access)': '(インターネットアクセスが必要)', '(something like "it-it")': '(例: "it-it")', '@markmin\x01Sear...
Python
# coding: utf8 { '!langcode!': 'cs-cz', '!langname!': 'čeština', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': 'Kolonka "Upravit" je nepovinný výraz, například "pole1=\'nováhodnota\'". Výsledky databázového JOINu nemůžete mazat ani upravovat.', ...
Python
# coding: utf8 { '!langcode!': 'sr-lt', '!langname!': 'Srpski (Latinica)', '%Y-%m-%d': '%d-%m-%Y', '%Y-%m-%d %H:%M:%S': '%d-%m-%Y %H:%M:%S', '(requires internet access)': '(zahtijeva pristup internetu)', '(something like "it-it")': '(nešto kao "it-it")', '@markmin\x01(file **gluon/contrib/plural_rules/%s.py** is not fo...
Python
# coding: utf8 { '!langcode!': 'af', '!langname!': 'Afrikaanse', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', '%s %%{row} deleted': '%s rows deleted', '%s %%{row} updated': '%s rows updated', '(requires internet access)': '(vereis internet toegang)', '(something like "it-it")': '(iets soos "it-it")...
Python
# coding: utf8 { '!langcode!': 'uk', '!langname!': 'Українська', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Оновити" це додатковий вираз, такий, як "field1=\'нове_значення\'". Ви не можете змінювати або вилучати дані об\'єднаних таблиць', '"User...
Python
# coding: utf8 { '!langcode!': 'pl', '!langname!': 'Polska', '"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...
Python
# coding: utf8 { '!langcode!': 'ru', '!langname!': 'Русский', '"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', '%s %%{row} d...
Python
# coding: utf8 # Translation by: Klaus Kappel <kkappel@yahoo.de> { '!langcode!': 'de', '!langname!': 'Deutsch', '"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...
Python
# coding: utf8 { '!langcode!': 'bg', '!langname!': 'Български', '"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', ...
Python
# coding: utf8 { '!langcode!': 'pt', '!langname!': 'Português', '"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...
Python
# coding: utf8 { '!langcode!': 'sl', '!langname!': 'Slovenski', '"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...
Python
#!/usr/bin/env python { # "singular form (0)": ["first plural form (1)", "second plural form (2)", ...], 'файл': ['файли','файлів'], }
Python
# coding: utf8 { '!langcode!': 'he-il', '!langname!': 'עברית', '"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...
Python
# coding: utf8 { '!langcode!': 'fr', '!langname!': 'Français', '"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 j...
Python
# coding: utf8 { '!langcode!': 'nl', '!langname!': 'Nederlands', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is een optionele expressie zoals "veld1=\'nieuwewaarde\'". Je kan de resultaten van een JOIN niet updaten of verwijderen.', '"Use...
Python
# coding: utf8 { '!langcode!': 'zh-tw', '!langname!': '台灣中文', '"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 %...
Python
# coding: utf8 { '!langcode!': 'en-us', '!langname!': 'English (US)', '%Y-%m-%d': '%m-%d-%Y', '%Y-%m-%d %H:%M:%S': '%m-%d-%Y %H:%M:%S', '(requires internet access)': '(requires internet access)', '(something like "it-it")': '(something like "it-it")', 'About': 'About', 'Additional code for your application': 'Additiona...
Python
# coding: utf8 { '!=': '!=', '!langcode!': 'ro', '!langname!': 'Română', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" (actualizează) este o expresie opțională precum "câmp1=\'valoare_nouă\'". Nu puteți actualiza sau șterge rezultatele unui...
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.multi-select.js')) response.files.append(URL('static', 'plugin_multiselect/multi-select.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 allo...
Python
import base64 import os import 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_ho...
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 is_mobile: ret = A_button(SPAN(label), _href=href) else: ret = A(SPAN(label), _class='button btn', _href=href) return ret d...
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 * auth = Auth( globals(), db) # authentication/authoriz...
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 try: from mercurial.scmutil import addremove except: from mercurial.cmdutil import addremove ...
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))) ...
Python
import os import sys import cStringIO import gluon.contrib.shell import gluon.dal import gluon.html import gluon.validators import code import 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') redirec...
Python
import os try: from distutils import dir_util except ImportError: session.flash = T('requires distutils, but not installed') redirect(URL('default', 'site')) try: from git import * except ImportError: session.flash = T('requires python-git, but not installed') redirect(URL('default', 'site')) ...
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 try: import pygraphvi...
Python
import sys import cStringIO import gluon.contrib.shell import code import 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...
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')) if MULTI_USER_M...
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