code
stringlengths
1
1.72M
language
stringclasses
1 value
# Copyright 2012 Google Inc. All Rights Reserved. # # 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/LICENSE-2.0 # # Unless required by applicable law or ...
Python
# Copyright 2013 Google Inc. All Rights Reserved. # # 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/LICENSE-2.0 # # Unless required by applicable law or ...
Python
# Copyright 2012 Google Inc. All Rights Reserved. # # 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/LICENSE-2.0 # # Unless required by applicable law or ...
Python
# Copyright 2012 Google Inc. All Rights Reserved. # # 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/LICENSE-2.0 # # Unless required by applicable law or ...
Python
# Copyright 2013 Google Inc. All Rights Reserved. # # 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/LICENSE-2.0 # # Unless required by applicable law or ...
Python
# Copyright 2012 Google Inc. All Rights Reserved. # # 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/LICENSE-2.0 # # Unless required by applicable law or ...
Python
# Copyright 2012 Google Inc. All Rights Reserved. # # 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/LICENSE-2.0 # # Unless required by applicable law or ...
Python
#==================================================================== # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you ...
Python
#!/usr/bin/env python from setuptools import setup from feedformatter import __version__ as version setup( name='feedformatter', version=version, description='A Python library for generating news feeds in RSS and Atom formats', author='Luke Maurits', author_email='luke@maurits.id.au', url='http...
Python
#!/usr/bin/env python from setuptools import setup from feedformatter import __version__ as version setup( name='feedformatter', version=version, description='A Python library for generating news feeds in RSS and Atom formats', author='Luke Maurits', author_email='luke@maurits.id.au', url='http...
Python
# Feedformatter # Copyright (c) 2008, Luke Maurits <luke@maurits.id.au> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice,...
Python
#!/usr/bin/env python from setuptools import setup from feedformatter import __version__ as version setup( name='feedformatter', version=version, description='A Python library for generating news feeds in RSS and Atom formats', author='Luke Maurits', author_email='luke@maurits.id.au', url='http...
Python
#!/usr/bin/env python from setuptools import setup from feedformatter import __version__ as version setup( name='feedformatter', version=version, description='A Python library for generating news feeds in RSS and Atom formats', author='Luke Maurits', author_email='luke@maurits.id.au', url='http...
Python
'''module to create atom and rss feeds''' # Feedformatter # Copyright (c) 2008, Luke Maurits <luke@maurits.id.au> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source co...
Python
#!/usr/bin/env python from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app from google.appengine.api import urlfetch import urllib from django.utils import simplejson class HatenaBookmarkFlare(webapp.RequestHandler): def get(self): url = self.request.get('url', defaul...
Python
#!/usr/bin/env python from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app from google.appengine.api import urlfetch import urllib from django.utils import simplejson class LivedoorClipFlare(webapp.RequestHandler): def get(self): url = self.request.get('url', default_...
Python
#!/usr/bin/env python from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app class RootHandler(webapp.RequestHandler): def get(self): path_url = self.request.path_url self.response.out.write(""" <html> <body> <h1>FeedFlare-AppEngine</h1> <dl> <dt>code</dt><dd><a hr...
Python
#!/usr/bin/env python from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app from google.appengine.api import urlfetch import urllib from django.utils import simplejson class HatenaBookmarkFlare(webapp.RequestHandler): def get(self): url = self.request.get('url', defaul...
Python
#!/usr/bin/env python from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app from google.appengine.api import urlfetch import urllib from django.utils import simplejson class LivedoorClipFlare(webapp.RequestHandler): def get(self): url = self.request.get('url', default_...
Python
#!/usr/bin/env python from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app class RootHandler(webapp.RequestHandler): def get(self): path_url = self.request.path_url self.response.out.write(""" <html> <body> <h1>FeedFlare-AppEngine</h1> <dl> <dt>code</dt><dd><a hr...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- # # feedmaker.py # # The MIT License # # Copyright (c) 2011 Clifton Chandler # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Softw...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- # # feedmaker.py # # The MIT License # # Copyright (c) 2011 Clifton Chandler # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Softw...
Python
""" Copyright (C) 2009, Jackie Ng http://code.google.com/p/fdotoolbox, jumpinjackie@gmail.com This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at ...
Python
""" Copyright (C) 2009, Jackie Ng http://code.google.com/p/fdotoolbox, jumpinjackie@gmail.com This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at y...
Python
# Copyright (C) 2009, Jackie Ng # http:#code.google.com/p/fdotoolbox, jumpinjackie@gmail.com # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, ...
Python
# sdf2convert.py # # FDO Toolbox script to convert MapGuide 6.5 SDF files (SDF 2.0) to any FDO flat-file # data store. # # Author: Jackie Ng (jumpinjackie@gmail.com) # # TODO: Utilise MgCoordinateSystem API if available to perform CS lookups. from System import Activator, Type, Exception, String, Array from ...
Python
#!/usr/bin/env python import time t = time.time() u = time.gmtime(t) s = time.strftime('%a, %e %b %Y %T GMT', u) print 'Content-Type: text/javascript' print 'Cache-Control: no-cache' print 'Date: ' + s print 'Expires: ' + s print '' print 'var timeskew = new Date().getTime() - ' + str(t*1000) + ';'
Python
#!/usr/bin/python print "hello world"
Python
#!/usr/bin/python print "hello world"
Python
#!/usr/bin/python2.6 # # Copyright 2011 Google Inc. All Rights Reserved. # # 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/LICENSE-2.0 # # Unless required...
Python
#!/usr/bin/python # -*- coding: utf-8 -*- import gtk import webbrowser from pagewindow import * def on_click(self, widget, event): if self.pointer_on_rest == True: # Which button was clicked? self.pointer = self.window.get_pointer() for idx in range(self.feedrange[self.feedseq]): ...
Python
#!/usr/bin/python # -*- coding: utf-8 -*- import os import ConfigParser DIR_USER = os.environ['HOME'] + '/.feedbar' def getfeeds(): feeds = {} config = ConfigParser.RawConfigParser() config.read(DIR_USER + '/feeds.cfg') for x in config.sections(): if config.get(x, 'feed_type') == 'Feed': ...
Python
#!/usr/bin/python import sys import gobject from feedbar import feedbar #if __name__ == "__main__": feedbar.start_bar()
Python
#!/usr/bin/python import sys import gobject from mainbar import * #test APP_NAME = ('Feedbar') APP_VERSION = '0.01' DIR_USER = os.environ['HOME'] + '/.feedbar' DIR_TMP = '/tmp/feedbar/' #test def create_user_dir (): """Create the userdir for the feedbar.""" for x in [DIR_USER, DIR_USER + "/images", DIR_USE...
Python
#!/usr/bin/python # -*- coding: utf-8 -*- from twisted.internet import reactor from twisted.web.client import getPage import cairo import os import gtk #temporary, remove later DIR_USER = os.environ['HOME'] + '/.feedbar' DIR_IMG = os.environ['HOME'] + '/.feedbar/images/' DIR_TMP = '/tmp/feedbar/' if not os.path.isdir...
Python
#!/usr/bin/python # -*- coding: utf-8 -*- #TODO #fix atom summaries import os, sys import gtk import glib import cairo import time from twisted.internet import gtk2reactor gtk2reactor.install() from twisted.internet import reactor from twisted.web.client import getPage import html2text import logging, logging.handle...
Python
#!/usr/bin/python # -*- coding: utf-8 -*- import gtk import webkit import webbrowser class PageWindow: def __init__(self, link): self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.set_decorated(False) # self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_TOOLTIP) self.windo...
Python
#!/usr/bin/python # -*- coding: utf-8 -*- import os, sys import gtk import glib from django.utils.translation import ugettext_lazy as _ class Properties: def __init__(self): self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.set_title("FeedBar Options") self.window.set_icon_from_fil...
Python
#!/usr/bin/python # -*- coding: utf-8 -*- from twisted.web.client import getPage import feedparser import cairo import pango import os import glib from getlogo import * DIR_IMG = os.environ['HOME'] + '/.feedbar/images/' def RSSdraw(self, window_to_draw, cr): self.window = window_to_draw # detecting pointe...
Python
#!/usr/bin/env python import sys, os, glob from pkg_resources import require, DistributionNotFound, VersionConflict from setuptools import setup #try: # require('feedbar') # print # print 'You have Feedbar installed.' # print 'You need to remove Feedbar from your site-packages' # print 'before installi...
Python
import feeds def simple_format_link(entry): return "<a href=\"%s\">%s</a>" % (entry.link, entry.title) def get_feed_html(feed_url, n = 5, pattern = None, list_css_class = "feed-default", link_formatter = simple_format_link): f = feeds.Feeds() html = '<ul class="feed-entries %s">\n' % list_css_class...
Python
import sqlite3 import sys import feedparser from datetime import datetime DATABASE = 'feeds.sqlite' class Entry(object): pass class Feeds(object): def __init__(self): self.conn = sqlite3.connect(DATABASE) self.conn.row_factory = sqlite3.Row self._create_tables() def ...
Python
import feeds f = feeds.Feeds() print [e.link for e in f.get_recent('stackoverflow.xml')] f.close()
Python
#!/usr/bin/python2 import subprocess import signal code = r"""" (load "~/quicklisp/setup.lisp") (ql:quickload 'feedcircuit) (ql:quickload 's-http-server) (ql:quickload 's-utils) (ql:quickload 'puri) (rename-package :s-http-server :sfs) (defun write-text-response (request stream &optional text) (unless text (setf (...
Python
#!/usr/bin/python2 import subprocess import signal code = r"""" (load "~/quicklisp/setup.lisp") (ql:quickload 'feedcircuit) (ql:quickload 's-http-server) (ql:quickload 's-utils) (ql:quickload 'puri) (rename-package :s-http-server :sfs) (defun write-text-response (request stream &optional text) (unless text (setf (...
Python
''' Module which brings history information about files from Mercurial. @author: Rodrigo Damazio ''' import re import subprocess REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*') def _GetOutputLines(args): ''' Runs an external process and returns its output as a list of lines. @param args: the argume...
Python
#!/usr/bin/python ''' Entry point for My Tracks i18n tool. @author: Rodrigo Damazio ''' import mytracks.files import mytracks.translate import mytracks.validate import sys def Usage(): print 'Usage: %s <command> [<language> ...]\n' % sys.argv[0] print 'Commands are:' print ' cleanup' print ' translate' p...
Python
''' Module which prompts the user for translations and saves them. TODO: implement @author: Rodrigo Damazio ''' class Translator(object): ''' classdocs ''' def __init__(self, language): ''' Constructor ''' self._language = language def Translate(self, string_names): print string_names
Python
''' Module which compares languague files to the master file and detects issues. @author: Rodrigo Damazio ''' import os from mytracks.parser import StringsParser import mytracks.history class Validator(object): def __init__(self, languages): ''' Builds a strings file validator. Params: @para...
Python
''' Module for dealing with resource files (but not their contents). @author: Rodrigo Damazio ''' import os.path from glob import glob import re MYTRACKS_RES_DIR = 'MyTracks/res' ANDROID_MASTER_VALUES = 'values' ANDROID_VALUES_MASK = 'values-*' def GetMyTracksDir(): ''' Returns the directory in which the MyTrac...
Python
''' Module which parses a string XML file. @author: Rodrigo Damazio ''' from xml.parsers.expat import ParserCreate import re #import xml.etree.ElementTree as ET class StringsParser(object): ''' Parser for string XML files. This object is not thread-safe and should be used for parsing a single file at a time...
Python
#!/usr/bin/python import sys import os import re typeRinstructions = ['add', 'sub', 'and', 'or', 'nor', 'slt', 'jr'] typeIinstructions = ['addi', 'ori', 'lui'] typeBRANCHinstructions = ['beq'] typeMEMinstructions = ['lw', 'sw'] typeJinstructions = ['j', 'jal'] typeSHIFTinstructions = ['sll', 'srl'] typePseudoInstruct...
Python
#!/usr/bin/python import sys import os import re typeRinstructions = ['add', 'sub', 'and', 'or', 'nor', 'slt'] typeIinstructions = ['addi'] typeBRANCHinstructions = ['beq'] typeMEMinstructions = ['lw', 'sw'] typeJinstructions = ['j'] typeSHIFTinstructions = ['sll', 'srl'] instruction2opcode = { 'addi': 0x8, 'beq':...
Python
#!/usr/bin/python import sys import os import re typeRinstructions = ['add', 'sub', 'and', 'or', 'nor', 'slt'] typeIinstructions = ['addi'] typeBRANCHinstructions = ['beq'] typeMEMinstructions = ['lw', 'sw'] typeJinstructions = ['j'] typeSHIFTinstructions = ['sll', 'srl'] instruction2opcode = { 'addi': 0x8, 'beq':...
Python
#!/usr/bin/python import sys import os import re typeRinstructions = ['add', 'sub', 'and', 'or', 'nor', 'slt', 'jr'] typeIinstructions = ['addi', 'ori', 'lui'] typeBRANCHinstructions = ['beq'] typeMEMinstructions = ['lw', 'sw'] typeJinstructions = ['j', 'jal'] typeSHIFTinstructions = ['sll', 'srl'] typePseudoInstruct...
Python
import libtcodpy as libtcod INVENTORY_SIZE = 9 SCREEN_W = 80 SCREEN_H = 25 MAP_W = 59 MAP_H = 18 BUFFER_H = 5 FONTS = [ ('fonts/terminal10x18.png', libtcod.FONT_LAYOUT_ASCII_INROW), ('fonts/terminal8x15.png', libtcod.FONT_LAYOUT_ASCII_INROW), ('fonts/terminal8x8.png', libtcod.FONT_LAYOUT...
Python
from sys import stdout for i in range(16): for j in range(16): n = i*16+j if 32 <= n < 128: c = chr(n) else: c = '.' stdout.write(c) stdout.write('\n')
Python
import libtcodpy as T from settings import * from util import * from random import choice import ui class Item(object): ALL = [] __metaclass__ = Register ABSTRACT = True common = 10 glyph = UNKNOWN_GLYPH slot = None speed = 0 armor = 0 plural = False @property def descr(s...
Python
from random import randrange, choice, shuffle import libtcodpy as T # from corpse import Corpse from mob import Monster, UnrealMonster, Player, Boss from item import Item from mapgen import generate_map from settings import * from util import * import corpse import ui class Map(object): def __init__(self, level)...
Python
from random import randrange from sys import stdout import libtcodpy as T from settings import * from util import * def array_to_tiles(arr): import map TILE_TABLE = { '.': map.FloorTile, '#': map.WoodWallTile, ' ': map.WallTile, '>': map.StairDownTile, '<': map.StairUp...
Python
#!/usr/bin/python import sys import settings from game import Game if __name__ == '__main__': wizard = 'wizard' in sys.argv Game(wizard).play()
Python
from distutils.core import setup import py2exe # Run 'python win_setup.py py2exe' opts = { "py2exe": { "ascii": True, "excludes": ["_ssl"], "compressed": True, "excludes": ['_ssl', # Exclude _ssl 'pyreadline', 'difflib', 'doctest', 'locale', ...
Python
import libtcodpy as T from settings import * from util import * from random import choice # from mob import Monster import mob import ui class Corpse(object): """Represents all manner of dead creatures""" # The following would be used for Madness' class-based random select # ALL = [] # __metaclass__ ...
Python
from __future__ import with_statement import libtcodpy as T from settings import * from map import * from mob import * from item import * from util import in_map import ui KEYS = [ (['y', '7'], ('walk', (-1, -1))), (['k', '8', T.KEY_UP], ('walk', (0, -1))), (['u', '9'], ('walk', (1, -1))), (['h', '4',...
Python
from random import randrange, choice import libtcodpy as T from settings import * ALL_DIRS = [] for dx in range(-1,2): for dy in range(-1,2): if (dx, dy) != (0, 0): ALL_DIRS.append((dx, dy)) def distance(x1, y1, x2, y2): dx = abs(x2-x1) dy = abs(y2-y1) return (dx+dy+max(dx,dy))/2...
Python
from random import choice, randrange, shuffle from util import * from mob import * import ui class InsaneEffect(object): letter = '?' add_message = '' remove_message = '' long_descr = '<description>' def add(self, player): self.player = player assert self.letter not in player.eff...
Python
# # libtcod 1.5.0 python wrapper # Copyright (c) 2008 Jice # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, th...
Python
from random import choice, random, shuffle from math import log import libtcodpy as T from settings import * from util import * from item import Item # do I need this? import corpse import ui class Mob(object): x, y = None, None glyph = UNKNOWN_GLYPH map = None enters_walls = False sanity_dice =...
Python
from random import choice import libtcodpy as T from settings import * from util import distance, describe_dice, in_map STATUS_W = SCREEN_W-MAP_W-2 STATUS_H = 10 INV_W = SCREEN_W INV_H = INVENTORY_SIZE + 3 FONT_INDEX = 0 def init(game): global CON_MAP, CON_BUFFER, CON_STATUS, CON_INV, MESSAGES, GAME GAME =...
Python
from app_settings import * #Page html code, do not change! html_code = """ <html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="%(host_url)s"> <head> <meta property="og:title" content="%(page_title)s" /> <meta property="og:url" content="%(host_url)s" /> <meta property="og:site_name" content="%(site_name)s"...
Python
app_id = '207535655979693' # your facebook app id app_secret = 'c937ba84e45eaae6b11964292bdfdb1e' #facebook app secret host_url = 'http://574556.appspot.com/' #You google app url redirect_url= 'http://www.google.com' #Where you want the user redirect to after they send the comment page_title = 'FREE $25 Tim H...
Python
from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app from app_settings import * from html_code import * class MainPage(webapp.RequestHandler): def get(self): self.response.headers['Content-Type'] = 'text/html' self.response.out.write(html_code) ...
Python
from google.appengine.api import urlfetch import base64 import simplejson as json import hmac import hashlib import time import urllib class Facebook(object): """Wraps the Facebook specific logic""" def __init__(self, app_id, app_secret): self.app_id = app_id self.app_secret = app_secret ...
Python
app_id = '199187756818254' # application id here app_secret = '319bb935676f58c9f98bb5828b63f604' # application secret here app_url = 'http://apps.facebook.com/xtrm-single/' # facebook application url app_scope = 'create_event,rsvp_event' # application permissions event_id = '327187503958075' # event id here invite_numb...
Python
import os, logging import urllib import random from google.appengine.dist import use_library use_library('django', '1.2') from google.appengine.ext import webapp from google.appengine.ext.webapp import template from google.appengine.ext.webapp.util import run_wsgi_app from app_settings import * from facebook_sdk ...
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 WSGI handler for Apache Requires apache+mod_wsgi. In httpd.conf put something like: LoadMo...
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 handler for lighttpd+fastcgi This file has to be in the PYTHONPATH Put something like this in the...
Python
password="cfcd208495d565ef66e7dff9f98764da"
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ scgihandler.py - handler for SCGI protocol Modified by Michele Comitini <michele.comitini@glisco.it> from fcgihandler.py to support SCGI fcgihandler has the following copyright: " This file is part of the web2py Web Framework Copyrighted by Massimo Di Pierro <mdipi...
Python
#!/usr/bin/python # -*- coding: utf-8 -*- # when web2py is run as a windows service (web2py.exe -W) # it does not load the command line options but it # expects to find conifguration settings in a file called # # web2py/options.py # # this file is an example for options.py import socket import os ip = '0.0.0.0' po...
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 file is based, althought a rewrite, on MIT code from the Bottle web framework. """ import os, sys, op...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Usage: Install py2exe: http://sourceforge.net/projects/py2exe/files/ Copy script to the web2py directory c:\bin\python26\python build_windows_exe.py py2exe Adapted from http://bazaar.launchpad.net/~flavour/sahana-eden/trunk/view/head:/static/scripts/tools/...
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) The widget is called from web2py. """ import sys import cStringIO import time import thread import re impo...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- # portalocker.py - Cross-platform (posix/nt) API for flock-style file locking. # Requires python 1.5.2 or better. """ Cross-platform (posix/nt) API for flock-style file locking. Synopsis: import portalocker file = open(\"somefile\", \"r+\") port...
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) """ from storage import Storage global_settings = Storage() settings = global_settings # legacy compatibility
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) """ __all__ = ['HTTP', 'redirect'] defined_status = { 200: 'OK', 201: 'CREATED', 202: 'ACCEPTE...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This file is part of the web2py Web Framework Developed by Massimo Di Pierro <mdipierro@cs.depaul.edu>, limodou <limodou@gmail.com> and srackham <srackham@gmail.com>. License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) """ import logging import pdb import Queue i...
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 file specifically includes utilities for security. """ import hashlib import hmac import uuid import ...
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) Provides: - List; like list but returns None instead of IndexOutOfBounds - Storage; like dictionary allowi...
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 # pattern to find defined tables regex_tables = re.compile(\ """^[\w]+\.define_table\(\...
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 * Niall Sweeny <niall.sweeny@fonjax.com> for MS SQL support * Marcel Leuthi <mluethi@mlsystem...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- import __builtin__ import os import re import sys import threading # Install the new import function: def custom_import_install(web2py_path): global _web2py_importer global _web2py_path if _web2py_importer: return # Already installed ...
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) Basic caching classes and methods ================================= - Cache - The generic caching object i...
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) Contains: - wsgibase: the gluon wsgi application """ import gc import cgi import cStringIO import Cookie imp...
Python
# this file exists for backward compatibility __all__ = ['DAL','Field','drivers'] from dal import DAL, Field, Table, Query, Set, Expression, Row, Rows, drivers, BaseAdapter, SQLField, SQLTable, SQLXorable, SQLQuery, SQLSet, SQLRows, SQLStorage, SQLDB, GQLDB, SQLALL, SQLCustomType
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :: # from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496942 # Title: Cross-site scripting (XSS) defense # Submitter: Josh Goldfoot (other recipes) # Last Updated: 2006/08/05 # Version no: 1.0 """ from htmllib import HTMLParser from ...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created by Attila Csipa <web2py@csipa.in.rs> Modified by Massimo Di Pierro <mdipierro@cs.depaul.edu> """ import sys import os import threading import logging import time import sched import re import datetime import platform import portalocker import fileutils import ...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This file is part of the web2py Web Framework (Copyrighted, 2007-2011). License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) Author: Thadeus Burgess Contributors: - Thank you to Massimo Di Pierro for creating the original gluon/template.py - Thank you to Jonathan...
Python
import codecs, encodings """Caller will hand this library a buffer and ask it to either convert it or auto-detect the type. Based on http://code.activestate.com/recipes/52257/ Licensed under the PSF License """ # None represents a potentially variable byte. "##" in the XML spec... autodetect_dict={ # bytepattern ...
Python
# encoding utf-8 __author__ = "Thadeus Burgess <thadeusb@thadeusb.com>" # we classify as "non-reserved" those key words that are explicitly known # to the parser but are allowed as column or table names. Some key words # that are otherwise non-reserved cannot be used as function or data type n # ames and ...
Python