ABOUT0000644000175000017500000000065011215551217010372 0ustar useruserWrite something about this app. Developed with web2py. About static/jquery.flot.pack.js -------------------------------- Flot is a Javascript plotting library for jQuery. Read more at the website: http://code.google.com/p/flot/ Take a look at the examples linked from above, they should give a good impression of what Flot can do and the source code of the examples is probably the fastest way to learn how to use Flot.cache/0000755000175000017500000000000011215533724010642 5ustar userusercache/cache.lock0000644000175000017500000000000011215533724012545 0ustar userusercontrollers/0000755000175000017500000000000011216021176012137 5ustar userusercontrollers/default.py0000644000175000017500000000042011216021062014123 0ustar useruser# coding: utf8 def index(): obj=P3D() obj.test_cube() return dict(obj=XML(obj.js(400,400))) def download(): """ allows downloading of uploaded files http://..../[app]/default/download/[filename] """ return response.download(request,db) controllers/appadmin.py0000644000175000017500000001750611215465627014327 0ustar useruser# coding: utf8 # ########################################################## # ## make sure administrator is on localhost # ########################################################### import os import socket import datetime import copy import gluon.contenttype import gluon.fileutils # ## crytical --- make a copy of the environment global_env = copy.copy(globals()) global_env['datetime'] = datetime http_host = request.env.http_host.split(':')[0] remote_addr = request.env.remote_addr try: hosts = (http_host, socket.gethostbyname(remote_addr)) except: hosts = (http_host, ) if remote_addr not in hosts: raise HTTP(400) if not gluon.fileutils.check_credentials(request): redirect('/admin') ignore_rw = True response.view = 'appadmin.html' response.menu = [[T('design'), False, URL('admin', 'default', 'design', args=[request.application])], [T('db'), False, URL(r=request, f='index')], [T('state'), False, URL(r=request, f='state')]] # ########################################################## # ## auxiliary functions # ########################################################### def get_databases(request): dbs = {} for (key, value) in global_env.items(): cond = False try: cond = isinstance(value, GQLDB) except: cond = isinstance(value, SQLDB) if cond: dbs[key] = value return dbs databases = get_databases(None) def eval_in_global_env(text): exec ('_ret=%s' % text, {}, global_env) return global_env['_ret'] def get_database(request): if request.args and request.args[0] in databases: return eval_in_global_env(request.args[0]) else: session.flash = T('invalid request') redirect(URL(r=request, f='index')) def get_table(request): db = get_database(request) if len(request.args) > 1 and request.args[1] in db.tables: return (db, request.args[1]) else: session.flash = T('invalid request') redirect(URL(r=request, f='index')) def get_query(request): try: return eval_in_global_env(request.vars.query) except Exception: return None # ########################################################## # ## list all databases and tables # ########################################################### def index(): return dict(databases=databases) # ########################################################## # ## insert a new record # ########################################################### def insert(): (db, table) = get_table(request) form = SQLFORM(db[table], ignore_rw=ignore_rw) if form.accepts(request.vars, session): response.flash = T('new record inserted') return dict(form=form) # ########################################################## # ## list all records in table and insert new record # ########################################################### def download(): import os db = get_database(request) return response.download(request,db) def csv(): import gluon.contenttype response.headers['Content-Type'] = \ gluon.contenttype.contenttype('.csv') db = get_database(request) query = get_query(request) if not query: return None response.headers['Content-disposition'] = 'attachment; filename=%s_%s.csv'\ % tuple(request.vars.query.split('.')[:2]) return str(db(query).select()) def import_csv(table, file): table.import_from_csv_file(file) def select(): import re db = get_database(request) dbname = request.args[0] regex = re.compile('(?P\w+)\.(?P\w+)=(?P\d+)') if request.vars.query: match = regex.match(request.vars.query) if match: request.vars.query = '%s.%s.%s==%s' % (request.args[0], match.group('table'), match.group('field'), match.group('value')) else: request.vars.query = session.last_query query = get_query(request) if request.vars.start: start = int(request.vars.start) else: start = 0 nrows = 0 stop = start + 100 table = None rows = [] orderby = request.vars.orderby if orderby: orderby = dbname + '.' + orderby if orderby == session.last_orderby: if orderby[0] == '~': orderby = orderby[1:] else: orderby = '~' + orderby session.last_orderby = orderby session.last_query = request.vars.query form = FORM(TABLE(TR(T('Query:'), '', INPUT(_style='width:400px', _name='query', _value=request.vars.query or '', requires=IS_NOT_EMPTY(error_message=T("Cannot be empty")))), TR(T('Update:'), INPUT(_name='update_check', _type='checkbox', value=False), INPUT(_style='width:400px', _name='update_fields', _value=request.vars.update_fields or '')), TR(T('Delete:'), INPUT(_name='delete_check', _class='delete', _type='checkbox', value=False), ''), TR('', '', INPUT(_type='submit', _value='submit'))), _action=URL(r=request,args=request.args)) if request.vars.csvfile != None: try: import_csv(db[request.vars.table], request.vars.csvfile.file) response.flash = T('data uploaded') except: response.flash = T('unable to parse csv file') if form.accepts(request.vars, formname=None): regex = re.compile(request.args[0] + '\.(?P
\w+)\.id\>0') match = regex.match(form.vars.query.strip()) if match: table = match.group('table') try: nrows = db(query).count() if form.vars.update_check and form.vars.update_fields: db(query).update(**eval_in_global_env('dict(%s)' % form.vars.update_fields)) response.flash = T('%s rows updated', nrows) elif form.vars.delete_check: db(query).delete() response.flash = T('%s rows deleted', nrows) nrows = db(query).count() if orderby: rows = db(query).select(limitby=(start, stop), orderby=eval_in_global_env(orderby)) else: rows = db(query).select(limitby=(start, stop)) except: (rows, nrows) = ([], 0) response.flash = T('Invalid Query') return dict( form=form, table=table, start=start, stop=stop, nrows=nrows, rows=rows, query=request.vars.query, ) # ########################################################## # ## edit delete one record # ########################################################### def update(): (db, table) = get_table(request) try: id = int(request.args[2]) record = db(db[table].id == id).select()[0] except: session.flash = T('record does not exist') redirect(URL(r=request, f='select', args=request.args[:1], vars=dict(query='%s.%s.id>0' % tuple(request.args[:2])))) form = SQLFORM(db[table], record, deletable=True, delete_label=T('Check to delete'), ignore_rw=ignore_rw, linkto=URL(r=request, f='select', args=request.args[:1]), upload=URL(r=request, f='download', args=request.args[:1])) if form.accepts(request.vars, session): response.flash = T('done!') redirect(URL(r=request, f='select', args=request.args[:1], vars=dict(query='%s.%s.id>0' % tuple(request.args[:2])))) return dict(form=form) # ########################################################## # ## get global variables # ########################################################### def state(): return dict() controllers/default.py.bak0000644000175000017500000000425611215555024014703 0ustar useruser# coding: utf8 ######################################################################### ## This is a samples controller ## - index is the default action of any application ## - user is required for authentication and authorization ## - download is for downloading files uploaded in the db (does streaming) ## - call exposes all registered services (none by default) ######################################################################### exec('from applications.%s.modules.computingd import Interface' % request.application) def index(): """ example action using the internationalization operator T and flash rendered by views/default/index.html or views/generic.html """ response.flash = T('Welcome to web2py') return dict(message=T('Hello World')) def ls(): return Interface('http://localhost:8001')('ls -l',output="xxx") def append(): return Interface('http://localhost:8001').append(request.args(0),'test') def replace(): return Interface('http://localhost:8001').replace(request.args(0),'test',1) def get(): return Interface('http://localhost:8001')[request.args(0)] def set(): Interface('http://localhost:8001')[request.args(0)] = request.args(1) return 'done' def plot(): return dict() def user(): """ exposes: http://..../[app]/default/user/login http://..../[app]/default/user/logout http://..../[app]/default/user/register http://..../[app]/default/user/profile http://..../[app]/default/user/retrieve_password http://..../[app]/default/user/change_password use @auth.requires_login() @auth.requires_membership('group name') @auth.requires_permission('read','table name',record_id) to decorate functions that need access control """ return dict(form=auth()) def download(): """ allows downloading of uploaded files http://..../[app]/default/download/[filename] """ return response.download(request,db) def call(): """ exposes services. for example: http://..../[app]/default/call/jsonrpc decorate with @services.jsonrpc the functions to expose supports xml, json, xmlrpc, jsonrpc, amfrpc, rss, csv """ return service() cron/0000755000175000017500000000000011215511121010523 5ustar useruserdatabases/0000755000175000017500000000000011216021542011515 5ustar useruserdatabases/storage.sqlite0000644000000000000000000000000011216021542014352 0ustar rootrooterrors/0000755000175000017500000000000011216021343011101 5ustar useruser__init__.py0000644000175000017500000000000011203316461011670 0ustar useruser__init__.pyc0000644000175000017500000000022111215533724012046 0ustar useruser 1 Jc@sdS(N((((s:/Users/mdipierro/web2py/applications/computing/__init__.pysslanguages/0000755000175000017500000000000011215511121011530 5ustar useruserlanguages/pt.py0000644000175000017500000000541711202315701012536 0ustar useruser{ '"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 rows deleted': '%s linhas eliminadas', '%s rows updated': '%s linhas actualizadas', 'Available databases and tables': 'Available databases and tables', 'Cannot be empty': 'Cannot be empty', 'Check to delete': 'Check to delete', 'Current request': 'Current request', 'Current response': 'Current response', 'Current session': 'Current session', 'Delete:': 'Delete:', 'Edit current record': 'Edit current record', 'Hello World': 'Ol\xc3\xa1 Mundo', 'Import/Export': 'Import/Export', 'Internal State': 'Internal State', 'Invalid Query': 'Consulta Inv\xc3\xa1lida', 'New Record': 'New Record', 'No databases in this application': 'No databases in this application', 'Query:': 'Query:', 'Rows in table': 'Rows in table', 'Rows selected': 'Rows selected', 'Sure you want to delete this object?': 'Tem a certeza que deseja eliminar este objecto?', 'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.', 'Update:': 'Update:', 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.', 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.', 'Welcome to Gluonization': 'Bem vindo ao Web2py', 'Welcome to web2py': 'Welcome to web2py', 'click here for online examples': 'Clique aqui para exemplos online', 'click here for the administrative interface': 'Clique aqui para o painel administrativo', 'data uploaded': 'informa\xc3\xa7\xc3\xa3o enviada', 'database': 'database', 'database %s select': 'database %s select', 'db': 'bd', 'design': 'design', 'done!': 'conclu\xc3\xaddo!', 'export as csv file': 'export as csv file', 'insert new': 'insert new', 'insert new %s': 'insert new %s', 'invalid request': 'Pedido Inv\xc3\xa1lido', 'new record inserted': 'novo registo inserido', 'next 100 rows': 'next 100 rows', 'or import from csv file': 'or import from csv file', 'previous 100 rows': 'previous 100 rows', 'record does not exist': 'registo inexistente', 'record id': 'record id', 'selected': 'selected', 'state': 'estado', 'table': 'table', 'unable to parse csv file': 'n\xc3\xa3o foi poss\xc3\xadvel carregar ficheiro csv', } languages/pt-br.py0000644000175000017500000000563411206032053013140 0ustar useruser{ '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" \xc3\xa9 uma express\xc3\xa3o opcional como "campo1=\'novovalor\'". Voc\xc3\xaa n\xc3\xa3o pode atualizar ou apagar os resultados de um JOIN', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', '%s rows deleted': '%s linhas apagadas', '%s rows updated': '%s linhas atualizadas', 'Available databases and tables': 'Bancos de dados e tabelas dispon\xc3\xadveis', 'Cannot be empty': 'N\xc3\xa3o pode ser vazio', 'Check to delete': 'Marque para apagar', 'Current request': 'Requisi\xc3\xa7\xc3\xa3o atual', 'Current response': 'Resposta atual', 'Current session': 'Sess\xc3\xa3o atual', 'Delete:': 'Apagar:', 'Edit current record': 'Editar o registro atual', 'Hello World': 'Ol\xc3\xa1 Mundo', 'Import/Export': 'Importar/Exportar', 'Internal State': 'Estado Interno', 'Invalid Query': 'Consulta Inv\xc3\xa1lida', 'Login': 'Autentique-se', 'Lost Password': 'Esqueceu sua senha?', 'New Record': 'Novo Registro', 'No databases in this application': 'Sem bancos de dados nesta aplica\xc3\xa7\xc3\xa3o', 'Query:': 'Consulta:', 'Register': 'Registre-se', 'Rows in table': 'Linhas na tabela', 'Rows selected': 'Linhas selecionadas', 'Sure you want to delete this object?': 'Est\xc3\xa1 certo(a) que deseja apagar esse objeto ?', 'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'Uma "consulta" \xc3\xa9 uma condi\xc3\xa7\xc3\xa3o como "db.tabela1.campo1==\'valor\'". Express\xc3\xb5es como "db.tabela1.campo1==db.tabela2.campo2" resultam em um JOIN SQL.', 'Update:': 'Atualizar:', 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Use (...)&(...) para AND, (...)|(...) para OR, e ~(...) para NOT para construir consultas mais complexas.', 'Welcome to web2py': 'Bem vindo ao web2py', 'click here for online examples': 'clique aqui para ver alguns exemplos', 'click here for the administrative interface': 'clique aqui para acessar a interface administrativa', 'customize me!': 'Personalize-me!', 'data uploaded': 'dados enviados', 'database': 'banco de dados', 'database %s select': 'Selecionar banco de dados %s', 'db': 'db', 'design': 'design', 'done!': 'conclu\xc3\xaddo!', 'export as csv file': 'exportar como um arquivo csv', 'insert new': 'inserir novo', 'insert new %s': 'inserir novo %s', 'invalid request': 'requisi\xc3\xa7\xc3\xa3o inv\xc3\xa1lida', 'new record inserted': 'novo registro inserido', 'next 100 rows': 'pr\xc3\xb3ximas 100 linhas', 'or import from csv file': 'ou importar de um arquivo csv', 'previous 100 rows': '100 linhas anteriores', 'record does not exist': 'registro n\xc3\xa3o existe', 'record id': 'id do registro', 'selected': 'selecionado', 'state': 'estado', 'table': 'tabela', 'unable to parse csv file': 'n\xc3\xa3o foi poss\xc3\xadvel analisar arquivo csv', } languages/pt-pt.py0000644000175000017500000000541711202315736013167 0ustar useruser{ '"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 rows deleted': '%s linhas eliminadas', '%s rows updated': '%s linhas actualizadas', 'Available databases and tables': 'Available databases and tables', 'Cannot be empty': 'Cannot be empty', 'Check to delete': 'Check to delete', 'Current request': 'Current request', 'Current response': 'Current response', 'Current session': 'Current session', 'Delete:': 'Delete:', 'Edit current record': 'Edit current record', 'Hello World': 'Ol\xc3\xa1 Mundo', 'Import/Export': 'Import/Export', 'Internal State': 'Internal State', 'Invalid Query': 'Consulta Inv\xc3\xa1lida', 'New Record': 'New Record', 'No databases in this application': 'No databases in this application', 'Query:': 'Query:', 'Rows in table': 'Rows in table', 'Rows selected': 'Rows selected', 'Sure you want to delete this object?': 'Tem a certeza que deseja eliminar este objecto?', 'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.', 'Update:': 'Update:', 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.', 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.', 'Welcome to Gluonization': 'Bem vindo ao Web2py', 'Welcome to web2py': 'Welcome to web2py', 'click here for online examples': 'Clique aqui para exemplos online', 'click here for the administrative interface': 'Clique aqui para o painel administrativo', 'data uploaded': 'informa\xc3\xa7\xc3\xa3o enviada', 'database': 'database', 'database %s select': 'database %s select', 'db': 'bd', 'design': 'design', 'done!': 'conclu\xc3\xaddo!', 'export as csv file': 'export as csv file', 'insert new': 'insert new', 'insert new %s': 'insert new %s', 'invalid request': 'Pedido Inv\xc3\xa1lido', 'new record inserted': 'novo registo inserido', 'next 100 rows': 'next 100 rows', 'or import from csv file': 'or import from csv file', 'previous 100 rows': 'previous 100 rows', 'record does not exist': 'registo inexistente', 'record id': 'record id', 'selected': 'selected', 'state': 'estado', 'table': 'table', 'unable to parse csv file': 'n\xc3\xa3o foi poss\xc3\xadvel carregar ficheiro csv', } languages/pl.py0000644000175000017500000000617211214730602012531 0ustar useruser{ '"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-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', '%s rows deleted': 'Wierszy usuni\xc4\x99tych: %s', '%s rows updated': 'Wierszy uaktualnionych: %s', 'Available databases and tables': 'Dost\xc4\x99pne bazy danych i tabele', 'Cannot be empty': 'Nie mo\xc5\xbce by\xc4\x87 puste', 'Change Password': 'Change Password', 'Check to delete': 'Zaznacz aby usun\xc4\x85\xc4\x87', 'Current request': 'Aktualne \xc5\xbc\xc4\x85danie', 'Current response': 'Aktualna odpowied\xc5\xba', 'Current session': 'Aktualna sesja', 'Delete:': 'Usu\xc5\x84:', 'Edit Profile': 'Edit Profile', 'Edit current record': 'Edytuj aktualny rekord', 'Hello World': 'Witaj \xc5\x9awiecie', 'Import/Export': 'Importuj/eksportuj', 'Internal State': 'Stan wewn\xc4\x99trzny', 'Invalid Query': 'B\xc5\x82\xc4\x99dne zapytanie', 'Login': 'Zaloguj', 'Logout': 'Logout', 'Lost Password': 'Przypomnij has\xc5\x82o', 'New Record': 'Nowy rekord', 'No databases in this application': 'Brak baz danych w tej aplikacji', 'Query:': 'Zapytanie:', 'Register': 'Zarejestruj', 'Rows in table': 'Wiersze w tabeli', 'Rows selected': 'Wybrane wiersze', 'Sure you want to delete this object?': 'Czy na pewno chcesz usun\xc4\x85\xc4\x87 ten obiekt?', 'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': '"Zapytanie" jest warunkiem postaci "db.tabela1.pole1==\'warto\xc5\x9b\xc4\x87\'". Takie co\xc5\x9b jak "db.tabela1.pole1==db.tabela2.pole2" oznacza SQL JOIN.', 'Update:': 'Uaktualnij:', 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'U\xc5\xbcyj (...)&(...) jako AND, (...)|(...) jako OR oraz ~(...) jako NOT do tworzenia bardziej skomplikowanych zapyta\xc5\x84.', 'Welcome to web2py': 'Witaj w web2py', 'click here for online examples': 'Kliknij aby przej\xc5\x9b\xc4\x87 do interaktywnych przyk\xc5\x82ad\xc3\xb3w', 'click here for the administrative interface': 'Kliknij aby przej\xc5\x9b\xc4\x87 do panelu administracyjnego', 'customize me!': 'dostosuj mnie!', 'data uploaded': 'dane wys\xc5\x82ane', 'database': 'baza danych', 'database %s select': 'wyb\xc3\xb3r z bazy danych %s', 'db': 'baza danych', 'design': 'projektuj', 'done!': 'zrobione!', 'export as csv file': 'eksportuj jako plik csv', 'insert new': 'wstaw nowy rekord tabeli', 'insert new %s': 'wstaw nowy rekord do tabeli %s', 'invalid request': 'B\xc5\x82\xc4\x99dne \xc5\xbc\xc4\x85danie', 'new record inserted': 'nowy rekord zosta\xc5\x82 wstawiony', 'next 100 rows': 'nast\xc4\x99pne 100 wierszy', 'or import from csv file': 'lub zaimportuj z pliku csv', 'previous 100 rows': 'poprzednie 100 wierszy', 'record does not exist': 'rekord nie istnieje', 'record id': 'id rekordu', 'selected': 'wybranych', 'state': 'stan', 'table': 'tabela', 'unable to parse csv file': 'nie mo\xc5\xbcna sparsowa\xc4\x87 pliku csv', } languages/it-it.py0000644000175000017500000000522011202315603013132 0ustar useruser{ '"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 rows deleted': '%s records cancellati', '%s rows updated': '*** %s records modificati', 'Available databases and tables': 'Available databases and tables', 'Cannot be empty': 'Cannot be empty', 'Check to delete': 'Check to delete', 'Current request': 'Current request', 'Current response': 'Current response', 'Current session': 'Current session', 'Delete:': 'Delete:', 'Edit current record': 'Edit current record', 'Hello World': 'Salve Mondo', 'Import/Export': 'Import/Export', 'Internal State': 'Internal State', 'Invalid Query': 'Query invalida', 'New Record': 'New Record', 'No databases in this application': 'No databases in this application', 'Query:': 'Query:', 'Rows in table': 'Rows in table', 'Rows selected': 'Rows selected', 'Sure you want to delete this object?': 'Sicuro che vuoi cancellare questo oggetto?', 'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.', 'Update:': 'Update:', 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.', 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.', 'Welcome to web2py': 'Ciao da wek2py', 'click here for online examples': 'clicca per vedere gli esempi', 'click here for the administrative interface': "clicca per l'interfaccia administrativa", 'data uploaded': 'dati caricati', 'database': 'database', 'database %s select': 'database %s select', 'db': 'db', 'design': 'progetta', 'done!': 'fatto!', 'export as csv file': 'export as csv file', 'insert new': 'insert new', 'insert new %s': 'insert new %s', 'invalid request': 'richiesta invalida!', 'new record inserted': 'nuovo record inserito', 'next 100 rows': 'next 100 rows', 'or import from csv file': 'or import from csv file', 'previous 100 rows': 'previous 100 rows', 'record does not exist': 'il record non esiste', 'record id': 'record id', 'selected': 'selected', 'state': 'stato', 'table': 'table', 'unable to parse csv file': 'non so leggere questo csv file', } languages/pl-pl.py0000644000175000017500000000617211214730605013145 0ustar useruser{ '"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-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S', '%s rows deleted': 'Wierszy usuni\xc4\x99tych: %s', '%s rows updated': 'Wierszy uaktualnionych: %s', 'Available databases and tables': 'Dost\xc4\x99pne bazy danych i tabele', 'Cannot be empty': 'Nie mo\xc5\xbce by\xc4\x87 puste', 'Change Password': 'Change Password', 'Check to delete': 'Zaznacz aby usun\xc4\x85\xc4\x87', 'Current request': 'Aktualne \xc5\xbc\xc4\x85danie', 'Current response': 'Aktualna odpowied\xc5\xba', 'Current session': 'Aktualna sesja', 'Delete:': 'Usu\xc5\x84:', 'Edit Profile': 'Edit Profile', 'Edit current record': 'Edytuj aktualny rekord', 'Hello World': 'Witaj \xc5\x9awiecie', 'Import/Export': 'Importuj/eksportuj', 'Internal State': 'Stan wewn\xc4\x99trzny', 'Invalid Query': 'B\xc5\x82\xc4\x99dne zapytanie', 'Login': 'Zaloguj', 'Logout': 'Logout', 'Lost Password': 'Przypomnij has\xc5\x82o', 'New Record': 'Nowy rekord', 'No databases in this application': 'Brak baz danych w tej aplikacji', 'Query:': 'Zapytanie:', 'Register': 'Zarejestruj', 'Rows in table': 'Wiersze w tabeli', 'Rows selected': 'Wybrane wiersze', 'Sure you want to delete this object?': 'Czy na pewno chcesz usun\xc4\x85\xc4\x87 ten obiekt?', 'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': '"Zapytanie" jest warunkiem postaci "db.tabela1.pole1==\'warto\xc5\x9b\xc4\x87\'". Takie co\xc5\x9b jak "db.tabela1.pole1==db.tabela2.pole2" oznacza SQL JOIN.', 'Update:': 'Uaktualnij:', 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'U\xc5\xbcyj (...)&(...) jako AND, (...)|(...) jako OR oraz ~(...) jako NOT do tworzenia bardziej skomplikowanych zapyta\xc5\x84.', 'Welcome to web2py': 'Witaj w web2py', 'click here for online examples': 'Kliknij aby przej\xc5\x9b\xc4\x87 do interaktywnych przyk\xc5\x82ad\xc3\xb3w', 'click here for the administrative interface': 'Kliknij aby przej\xc5\x9b\xc4\x87 do panelu administracyjnego', 'customize me!': 'dostosuj mnie!', 'data uploaded': 'dane wys\xc5\x82ane', 'database': 'baza danych', 'database %s select': 'wyb\xc3\xb3r z bazy danych %s', 'db': 'baza danych', 'design': 'projektuj', 'done!': 'zrobione!', 'export as csv file': 'eksportuj jako plik csv', 'insert new': 'wstaw nowy rekord tabeli', 'insert new %s': 'wstaw nowy rekord do tabeli %s', 'invalid request': 'B\xc5\x82\xc4\x99dne \xc5\xbc\xc4\x85danie', 'new record inserted': 'nowy rekord zosta\xc5\x82 wstawiony', 'next 100 rows': 'nast\xc4\x99pne 100 wierszy', 'or import from csv file': 'lub zaimportuj z pliku csv', 'previous 100 rows': 'poprzednie 100 wierszy', 'record does not exist': 'rekord nie istnieje', 'record id': 'id rekordu', 'selected': 'wybranych', 'state': 'stan', 'table': 'tabela', 'unable to parse csv file': 'nie mo\xc5\xbcna sparsowa\xc4\x87 pliku csv', } languages/fr-fr.py0000644000175000017500000000543411202315640013130 0ustar useruser{ '"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 rows deleted': '%s rang\xc3\xa9es effac\xc3\xa9es', '%s rows updated': '%s rang\xc3\xa9es mises \xc3\xa0 jour', 'Available databases and tables': 'Available databases and tables', 'Cannot be empty': 'Cannot be empty', 'Check to delete': 'Check to delete', 'Current request': 'Current request', 'Current response': 'Current response', 'Current session': 'Current session', 'Delete:': 'Delete:', 'Edit current record': 'Edit current record', 'Hello World': 'Bonjour Monde', 'Import/Export': 'Import/Export', 'Internal State': 'Internal State', 'Invalid Query': 'Requ\xc3\xaate Invalide', 'New Record': 'New Record', 'No databases in this application': 'No databases in this application', 'Query:': 'Query:', 'Rows in table': 'Rows in table', 'Rows selected': 'Rows selected', 'Sure you want to delete this object?': 'Souhaitez vous vraiment effacercet objet?', 'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.', 'Update:': 'Update:', 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.', 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.', 'Welcome to web2py': 'Bienvenue sur web2py', 'click here for online examples': 'cliquez ici pour voir des exemples enligne', 'click here for the administrative interface': "cliquez ici pour aller\xc3\xa0 l'interface d'administration", 'data uploaded': 'donn\xc3\xa9es t\xc3\xa9l\xc3\xa9charg\xc3\xa9es', 'database': 'database', 'database %s select': 'database %s select', 'db': 'db', 'design': 'design', 'done!': 'fait!', 'export as csv file': 'export as csv file', 'insert new': 'insert new', 'insert new %s': 'insert new %s', 'invalid request': 'requ\xc3\xaate invalide', 'new record inserted': 'nouvelle archive ins\xc3\xa9r\xc3\xa9e', 'next 100 rows': 'next 100 rows', 'or import from csv file': 'or import from csv file', 'previous 100 rows': 'previous 100 rows', 'record does not exist': "l'archive n'existe pas", 'record id': 'record id', 'selected': 'selected', 'state': '\xc3\xa9tat', 'table': 'table', 'unable to parse csv file': "incapable d'analyser le fichier cvs", } languages/it.py0000644000175000017500000000522011202315655012527 0ustar useruser{ '"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 rows deleted': '%s records cancellati', '%s rows updated': '*** %s records modificati', 'Available databases and tables': 'Available databases and tables', 'Cannot be empty': 'Cannot be empty', 'Check to delete': 'Check to delete', 'Current request': 'Current request', 'Current response': 'Current response', 'Current session': 'Current session', 'Delete:': 'Delete:', 'Edit current record': 'Edit current record', 'Hello World': 'Salve Mondo', 'Import/Export': 'Import/Export', 'Internal State': 'Internal State', 'Invalid Query': 'Query invalida', 'New Record': 'New Record', 'No databases in this application': 'No databases in this application', 'Query:': 'Query:', 'Rows in table': 'Rows in table', 'Rows selected': 'Rows selected', 'Sure you want to delete this object?': 'Sicuro che vuoi cancellare questo oggetto?', 'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.', 'Update:': 'Update:', 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.', 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.', 'Welcome to web2py': 'Ciao da wek2py', 'click here for online examples': 'clicca per vedere gli esempi', 'click here for the administrative interface': "clicca per l'interfaccia administrativa", 'data uploaded': 'dati caricati', 'database': 'database', 'database %s select': 'database %s select', 'db': 'db', 'design': 'progetta', 'done!': 'fatto!', 'export as csv file': 'export as csv file', 'insert new': 'insert new', 'insert new %s': 'insert new %s', 'invalid request': 'richiesta invalida!', 'new record inserted': 'nuovo record inserito', 'next 100 rows': 'next 100 rows', 'or import from csv file': 'or import from csv file', 'previous 100 rows': 'previous 100 rows', 'record does not exist': 'il record non esiste', 'record id': 'record id', 'selected': 'selected', 'state': 'stato', 'table': 'table', 'unable to parse csv file': 'non so leggere questo csv file', } LICENSE0000644000175000017500000000020711201222575010575 0ustar useruserThis is a sample license. You can write here anything you want as long as you do not violate web2py copyright, trademark and license. models/0000755000175000017500000000000011216025043011051 5ustar userusermodels/menu.py0000644000175000017500000000556111216022306012375 0ustar useruser# coding: utf8 ######################################################################### ## Customize your APP title, subtitle and menus here ######################################################################### response.title = '3D visualization' response.subtitle = 'A thin 3D layer on top of processing.js' ########################################## ## this is the authentication menu ## remove if not necessary ########################################## if 'auth' in globals(): if not auth.is_logged_in(): response.menu_auth = [ [T('Login'), False, auth.settings.login_url, [ [T('Register'), False, URL(request.application,'default','user/register')], [T('Lost Password'), False, URL(request.application,'default','user/retrieve_password')]] ], ] else: response.menu_auth = [ ['User: '+auth.user.first_name,False,None, [ [T('Logout'), False, URL(request.application,'default','user/logout')], [T('Edit Profile'), False, URL(request.application,'default','user/profile')], [T('Change Password'), False, URL(request.application,'default','user/change_password')]] ], ] ########################################## ## this is the main applicaiton menu ## add/remove items as required ########################################## response.menu = [ ['Index', False, URL(request.application,'default','index'), []], ] ########################################## ## this is here to provide shortcuts ## during development. remove in production ########################################## response.menu_edit=[ ['Edit', False, URL('admin', 'default', 'design/%s' % request.application), [ ['Controller', False, URL('admin', 'default', 'edit/%s/controllers/default.py' \ % request.application)], ['View', False, URL('admin', 'default', 'edit/%s/views/%s' \ % (request.application,response.view))], ['Layout', False, URL('admin', 'default', 'edit/%s/views/layout.html' \ % request.application)], ['Stylesheet', False, URL('admin', 'default', 'edit/%s/static/base.css' \ % request.application)], ['DB Model', False, URL('admin', 'default', 'edit/%s/models/db.py' \ % request.application)], ['Menu Model', False, URL('admin', 'default', 'edit/%s/models/menu.py' \ % request.application)], ['Database', False, URL(request.application, 'appadmin', 'index')], ] ], ] models/db.py0000644000175000017500000000613711216014225012017 0ustar useruser# coding: utf8 ######################################################################### ## This scaffolding model makes your app work on Google App Engine too ######################################################################### if request.env.web2py_runtime_gae: # if running on Google App Engine from gluon.contrib.gql import * ### connect to Google BigTable db = GQLDB() ## and store sessions and tickets there session.connect(request, response, db=db) ### or use the following lines to store sessions in Memcache # from gluon.contrib.memdb import MEMDB # from google.appengine.api.memcache import Client # session.connect(request, response, db=MEMDB(Client())) else: # else use a normal relational database # if not, use SQLite or other DB db = SQLDB('sqlite://storage.sqlite') ######################################################################### ## uncomment the following line if you do not want sessions #session.forget() ######################################################################### ######################################################################### ## Define your tables below, for example ## ## >>> db.define_table('mytable',SQLField('myfield','string')) ## ## Fields can be 'string','text','password','integer','double','boolean' ## 'date','time','datetime','blob','upload', 'reference TABLENAME' ## There is an implicit 'id integer autoincrement' field ## Consult manual for more options, validators, etc. ## ## More API examples for controllers: ## ## >>> db.mytable.insert(myfield='value') ## >>> rows=db(db.mytbale.myfield=='value).select(db.mytable.ALL) ## >>> for row in rows: print row.id, row.myfield ######################################################################### ######################################################################### ## Here is sample code if you need: ## - email capabilities ## - authentication (registration, login, logout, ... ) ## - authorization (role based authorization) ## - services (xml, csv, json, xmlrpc, jsonrpc, amf, rss) ## - crud actions ## comment/uncomment as needed ######################################################################### from gluon.tools import * #auth=Auth(globals(),db) # authentication/authorization #auth.define_tables() # creates all needed tables #crud=Crud(globals(),db) # for CRUD helpers using auth #service=Service(globals()) # for json, xml, jsonrpc, xmlrpc, amfrpc ## uncomment as necessary or consult docs for more options #crud.settings.auth=auth # (optional) enforces authorization on crud #mail=Mail() # mailer #mail.settings.server='smtp.gmail.com:587' # your SMTP server #mail.settings.sender='you@gmail.com' # your email #mail.settings.login='username:password' # your credentials #auth.settings.mailer=mail # for user email verification #auth.settings.registration_requires_verification = True #auth.settings.registration_requires_approval = True #auth.messages.verify_email = \ # 'Click on the link http://.../verify_email/%(key)s to verify your email' models/p3d.py0000644000175000017500000000641511216025015012116 0ustar useruserclass P3D: def __init__(self): self.lines=[] self.spheres=[] self.triangles=[] def line(self,x0,y0,z0,x1,y1,z1,stroke=1,red=255,green=255,blue=255): self.lines.append((x0,y0,z0,x1,y1,z1,stroke,red,green,blue)) def sphere(self,x0,y0,z0,radius=5,red=255,green=255,blue=255): self.spheres.append((x0,y0,z0,radius,red,green,blue)) def triangle(self,x0,y0,z0,x1,y1,z1,x2,y2,z2,red=255,green=255,blue=255): self.triangles.append((x0,y0,z0,x1,y1,z1,x2,y2,z2,red,green,blue)) def test_cube(self): for x in xrange(-100,200,200): for y in xrange(-100,200,200): for z in xrange(-100,200,200): if x>0: self.line(x,y,z,-x,y,z) if y>0: self.line(x,y,z,x,-y,z) if z>0: self.line(x,y,z,x,y,-z) self.sphere(x,y,z,radius=10,green=0) self.triangle(0,0,0,0,y,z,x,y,z,red=0) def lin(self,v): return ','.join([str(int(x)) for x in v]) def js(self, width=400, height=400): lines=','.join([self.lin(x) for x in self.lines]) spheres=','.join([self.lin(x) for x in self.spheres]) triangles=','.join([self.lin(x) for x in self.triangles]) return """ """ % (lines, spheres, triangles, width, height, width, height) modules/0000755000175000017500000000000011216021500011230 5ustar userusermodules/__init__.py0000644000175000017500000000000011201222575013340 0ustar useruserprivate/0000755000175000017500000000000011215511121011234 5ustar userusersessions/0000755000175000017500000000000011216113017011433 5ustar userusersessions/75-101-217-4-8030cc54-eefc-422f-aad9-0b93084ff06e0000644000000000000000000000000311216113017017525 0ustar rootroot(d.static/0000755000175000017500000000000011216113043011053 5ustar useruserstatic/processing.init.js0000755000175000017500000000164311215634744014555 0ustar useruser/* * This code searches for all the {{if request.function=='index':}}

{{=T("Available databases and tables")}}

{{if not databases:}}{{=T("No databases in this application")}}{{pass}} {{for db in sorted(databases):}} {{for table in databases[db].tables:}}

{{=A("%s.%s"%(db,table),_href=URL(r=request,f='select',args=[db],vars=dict(query='%s.%s.id>0'%(db,table))))}}

[ {{=A(str(T('insert new'))+' '+table,_href=URL(r=request,f='insert',args=[db,table]))}} ]

{{pass}} {{pass}} {{elif request.function=='select':}}

{{=XML(str(T("database %s select"))%A(request.args[0],_href=URL(r=request,f='index'))) }}

{{if table:}} [ {{=A(str(T('insert new %s'))%table,_href=URL(r=request,f='insert',args=[request.args[0],table]))}} ]

{{=T("Rows in table")}}


{{else:}}

{{=T("Rows selected")}}


{{pass}} {{=form}}

{{=T('The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.')}}
{{=T('Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.')}}
{{=T('"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN')}}



{{=nrows}} {{=T("selected")}}

{{if start>0:}}[ {{=A(T('previous 100 rows'),_href=URL(r=request,f='select',args=request.args[0],vars=dict(start=start-100)))}} ]{{pass}} {{if stop {{linkto=URL(r=request,f='update',args=request.args[0])}} {{upload=URL(r=request,f='download',args=request.args[0])}} {{=SQLTABLE(rows,linkto,upload,orderby=True,_class='sortable')}} {{pass}}

{{=T("Import/Export")}}


[ {{=T("export as csv file")}} ] {{if table:}} {{=FORM(str(T('or import from csv file'))+" ",INPUT(_type='file',_name='csvfile'),INPUT(_type='hidden',_value=table,_name='table'),INPUT(_type='submit',_value='import'))}} {{pass}} {{elif request.function=='insert':}}

{{=T("database")}} {{=A(request.args[0],_href=URL(r=request,f='index'))}} {{=T("table")}} {{=A(request.args[1],_href=URL(r=request,f='select',args=request.args[0],vars=dict(query='%s.%s.id>0'%tuple(request.args[:2]))))}}

{{=T("New Record")}}


{{=form}} {{elif request.function=='update':}}

{{=T("database")}} {{=A(request.args[0],_href=URL(r=request,f='index'))}} {{=T("table")}} {{=A(request.args[1],_href=URL(r=request,f='select',args=request.args[0],vars=dict(query='%s.%s.id>0'%tuple(request.args[:2]))))}} {{=T("record id")}} {{=A(request.args[2],_href=URL(r=request,f='update',args=request.args[:3]))}}

{{=T("Edit current record")}}



{{=form}} {{elif request.function=='state':}}

{{=T("Internal State")}}

{{=T("Current request")}}

{{=BEAUTIFY(request)}}

{{=T("Current response")}}

{{=BEAUTIFY(response)}}

{{=T("Current session")}}

{{=BEAUTIFY(session)}} {{pass}} views/generic.rss0000644000175000017500000000075411210247525013103 0ustar useruser{{ ### # response._vars contains the dictionary returned by the controller action # for this to work the action must return something like # # dict(title=...,link=...,description=...,created_on='...',items=...) # # items is a list of dictionaries each with title, link, description, pub_date. ### try: from gluon.serializers import rss response.write(rss(response._vars),escape=False) response.headers['Content-Type']='application/rss+xml' except: raise HTTP(405,'no rss') }}views/layout.html0000644000175000017500000000447011215547407013147 0ustar useruser {{=response.title or 'response.title'}} {{include 'web2py_ajax.html'}}

{{=response.title or 'response.title'}}

{{=response.subtitle or 'response.subtitle'}}

{{='/'.join(['',request.application,request.controller,request.function]+request.args)}}
{{if response.menu_auth:}}

Authentication

{{=MENU(response.menu_auth)}} {{pass}} {{if response.menu:}}

Main Menu

{{=MENU(response.menu)}} {{pass}} {{if response.menu_edit:}}

Edit This App

{{=MENU(response.menu_edit)}} {{pass}}
views/generic.html0000644000175000017500000000141111210247540013224 0ustar useruser{{extend 'layout.html'}} {{""" You should not modify this file. It is used as default when a view is not provided for your controllers """}} {{=BEAUTIFY(response._vars)}} views/web2py_ajax.html0000644000175000017500000000462111210244352014027 0ustar useruser{{import os}} views/default/0000755000175000017500000000000011216113006012344 5ustar useruserviews/default/user.html0000644000175000017500000000043111201233324014206 0ustar useruser{{extend 'layout.html'}}

{{=request.args[0].replace('_',' ').capitalize()}}

{{=form}} {{if request.args[0]=='login':}} register
lost password
{{pass}} views/default/index.html0000644000175000017500000000332511216112755014356 0ustar useruser{{extend 'layout.html'}}
Use the mouse to rotate
{{=obj}}

About

This is a web2py scaffolding app that includes a pure javascript widget for 3D visualization in the browser.

It is based on and includes the processing.js library developed by John Resig. You can rotate the image using the mouse. It can handle up to 1500 geometric primitives (lines, sheres, triangles). It is licensed under BSD license. The license does not cover nor overrides the processing.js license (in the code).

The widget (implemented in class P3D in file p3d.py) consists of server side Python code for building the object and client-side javascript code.

It DOES NOT REQUIRE web2py and can be used with any Python web framework.

Download

DOWNLOAD THIS WEB2PY APP.

Example of coding

In controller

{{=CODE(""" ## each point coordinate (x,y,z) has to be in -100,100 range. def index(): obj=P3D() obj.line(-100,-100,-100, 100,100,100, red=255,green=0,blue=0) obj.sphere(0,0,0, radius=20,red=0,green=255,blue=0) obj.triangle(0,0,0, 100,0,0, 100,100,0, red=255,green=0,blue=0) return dict(obj=XML(obj.js())) """.strip(),language="web2py")}}

In view

{{=CODE(""" { {extend 'layout.html'} } { {=obj} } """.replace('{ ','{').replace('} ','}').strip(),language="web2py")}}