code
stringlengths
1
1.72M
language
stringclasses
1 value
class FreeBlocksTable: def __init__(self): self.table={} def initialize(self,size): pos =0 while pos <= size: self.table[pos]=True pos= pos+1 def isEmpty(self): for i in self.table: if self.table[i]==True: ...
Python
class DirectoryEntry: def __init__(self, inodeID, fatherId, name): self.currentDir = inodeID self.fatherId= fatherId self.name = name self.directoryList = {} def addEntry(self,name,sonId): self.directoryList[sonId] =name def existInDirectory(self,...
Python
from disc import Disc from fileSystem import FileSystem def main(): disc= Disc(12) fs= FileSystem(disc) print disc.inodos fs.mkdir("var") #currentDirBeforeChangeDirBack = fs.currentDirectory print fs.currentDirectory.getInodeId("var"), fs.currentDirectory.currentDir fs.changeDir...
Python
import time, datetime # wrapper for class method class Callable: def __init__(self, anycallable): self.__call__ = anycallable class Timestamp: def __init__(self): pass def utcepoch(): return int(time.mktime(datetime.datetime.utcnow().timetuple())) def utcepoch_from(dt): ...
Python
import sys, os from optparse import OptionParser import csv from report_server import run_server from model import Node, connection import sqlite3 def run_report(rootdir, setid): nodes = list(connection.Node.find({'setid':str(setid)})) tup_nodes = [(x['path'],x['filename']) for x in nodes] conn = sqlite3.c...
Python
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler import socket class CSVNotExistError(Exception): def __init__(self, value): self.value = value def __str__(self): return repr(self.value) class Handler(BaseHTTPRequestHandler): def do_GET(self): try: with op...
Python
from mongokit import * class MongoDBManager(object): connection = None def get_connection(self): if self.connection is None: self.connection = Connection() return self.connection
Python
from optparse import OptionParser from model import Node, connection if __name__ == '__main__': usage = "usage: %prog [options] filenames" parser = OptionParser() parser.add_option("-p", action="store_true", default=False, help="path") parser.add_option("-d", action="store_true", default=False, help="d...
Python
import os, md5 from model import Node, connection from timestamp import Timestamp BLOCK_SIZE = os.stat('.').st_blksize def register(file, timestamp, setid): file_dirname = os.path.relpath(os.path.dirname(file)) file_basename = os.path.basename(file) with open(file, 'r') as f: d = f.read(BLOCK_SIZE) d...
Python
import datetime from mongodb_manager import * connection = MongoDBManager().get_connection() @connection.register class Node(Document): __collection__ = 'nodes' __database__ = 'filetree' structure = { 'setid':unicode, 'path':unicode, 'filename':unicode, 'is_symlink':bool, ...
Python
import sys, os from register import register from timestamp import Timestamp def treewalk(root): epoch = Timestamp.utcepoch() for root, dirs, files in os.walk(root, topdown=True, followlinks=True): print "entering ==> ", os.path.relpath(root) print "dirs : ", dirs for f in files: ...
Python
#!/usr/bin/env python ############################################################################################### # Author: _author = '<a href="mailto:debuti@gmail.com">Borja Garcia</a>' # Program: _name = 'template' # Descrip: _description = ''' ''' # Version: _version = '0.0.0' # Date: _date = ...
Python
#!/usr/bin/env python ############################################################################################### # Author: _author = '<a href="mailto:debuti@gmail.com">Borja Garcia</a>' # Program: _name = 'configTemplate' # Descrip: _description = '''This scripts customizes the project and copies the required ...
Python
#!/usr/bin/env python ############################################################################################### # Author: _author = '<a href="mailto:debuti@gmail.com">Borja Garcia</a>' # Program: _name = 'template' # Descrip: _description = ''' ''' # Version: _version = '0.0.0' # Date: _date = 'YYYY-MM-DD...
Python
#!/usr/bin/python import httplib2 import os import random import sys import time from apiclient.discovery import build from apiclient.errors import HttpError from oauth2client.file import Storage from oauth2client.client import flow_from_clientsecrets from oauth2client.tools import run from optparse import OptionPars...
Python
#!/usr/bin/python import httplib2 import os import random import sys import time from apiclient.discovery import build from apiclient.errors import HttpError from oauth2client.file import Storage from oauth2client.client import flow_from_clientsecrets from oauth2client.tools import run from optparse import OptionPars...
Python
#!/usr/bin/python from datetime import datetime, timedelta import httplib2 import os import sys from apiclient.discovery import build from oauth2client.file import Storage from oauth2client.client import flow_from_clientsecrets from oauth2client.tools import run from optparse import OptionParser # CLIENT_SECRETS_FI...
Python
#!/usr/bin/python import httplib2 import os import random import sys import time from apiclient.discovery import build from apiclient.errors import HttpError from oauth2client.file import Storage from oauth2client.client import flow_from_clientsecrets from oauth2client.tools import run from optparse import OptionPars...
Python
#!/usr/bin/python import httplib2 import os import random import sys import time from apiclient.discovery import build from apiclient.errors import HttpError from apiclient.http import MediaFileUpload from oauth2client.file import Storage from oauth2client.client import flow_from_clientsecrets from oauth2client.tools...
Python
#!/usr/bin/python import httplib2 import os import sys from apiclient.discovery import build from oauth2client.file import Storage from oauth2client.client import flow_from_clientsecrets from oauth2client.tools import run from optparse import OptionParser # CLIENT_SECRETS_FILE, name of a file containing the OAuth 2...
Python
#!/usr/bin/python import httplib import httplib2 import os import random import sys import time from apiclient.discovery import build from apiclient.errors import HttpError from apiclient.http import MediaFileUpload from oauth2client.file import Storage from oauth2client.client import flow_from_clientsecrets from oau...
Python
#!/usr/bin/python import httplib2 import os import sys from apiclient.discovery import build from oauth2client.file import Storage from oauth2client.client import flow_from_clientsecrets from oauth2client.tools import run # CLIENT_SECRETS_FILE, name of a file containing the OAuth 2.0 information for # this applicat...
Python
#!/usr/bin/python import httplib2 import os import sys from apiclient.discovery import build from oauth2client.file import Storage from oauth2client.client import flow_from_clientsecrets from oauth2client.tools import run # CLIENT_SECRETS_FILE, name of a file containing the OAuth 2.0 information for # this applicat...
Python
#!/usr/bin/python from apiclient.discovery import build from optparse import OptionParser # Set DEVELOPER_KEY to the "API key" value from the "Access" tab of the # Google APIs Console http://code.google.com/apis/console#access # Please ensure that you have enabled the YouTube Data API for your project. DEVELOPER_KEY ...
Python
#!/usr/bin/python import httplib2 import os import random import sys import time from apiclient.discovery import build from apiclient.errors import HttpError from oauth2client.file import Storage from oauth2client.client import flow_from_clientsecrets from oauth2client.tools import run from optparse import OptionPars...
Python
#!/usr/bin/python2.6 import gflags import httplib2 import os import sys import time from apiclient.discovery import build from apiclient.errors import HttpError from apiclient.http import MediaFileUpload from oauth2client.file import Storage from oauth2client.client import flow_from_clientsecrets from oauth2client.to...
Python
#!/usr/bin/python from apiclient.discovery import build from optparse import OptionParser import json import urllib # Set DEVELOPER_KEY to the "API key" value from the "Access" tab of the # Google APIs Console http://code.google.com/apis/console#access # Please ensure that you have enabled the YouTube Data API and ...
Python
#!/usr/bin/python import httplib2 import os import sys from apiclient.discovery import build from oauth2client.file import Storage from oauth2client.client import flow_from_clientsecrets from oauth2client.tools import run from optparse import OptionParser # CLIENT_SECRETS_FILE, name of a file containing the OAuth 2...
Python
# coding: utf-8 import os, sys import updater updater.main()
Python
# coding: utf-8 import os, sys, md5 import version def sumfile(filename): m = md5.new() fobj = open(filename, 'rb') while True: d = fobj.read(8086) if not d: break m.update(d) fobj.close() return m.hexdigest() def main(): noinstall = 'YouMone...
Python
#!/usr/bin/python import os, sys def change_version(filename, ver): fr = open(filename, 'r') fw = open(filename + '.new', 'w') for line in fr: if line.startswith('Version:'): fw.write('Version: %s\n' % (ver)) else: fw.write(line) fr.close() fw.close...
Python
# coding: utf-8 import os, sys def merge(samplefile, fromfile, tofile): olddict = {} oldf = open(samplefile, 'r') while True: line = oldf.readline() if not line: break if line.startswith('msgid'): idstr = line[5:].strip() line2 = oldf....
Python
# coding: utf-8 import os, sys, datetime, shutil import random import merge dstnames = ['youmoney_zh_CN', 'youmoney_ja_JP', 'youmoney_zh_TW'] def create_po(): tm = datetime.datetime.now() postfix = '%s%02d%02d.%02d%02d%02d' % tuple(tm.timetuple())[:6] home = os.path.dirname(os.path.dirname(os.path.abspat...
Python
# coding: utf-8 import os, sys import glob import version if sys.platform == 'darwin': from setuptools import setup setup(app = ["youmoney.py"], setup_requires=["py2app"], data_files = [('images', glob.glob('images/*.png')), ('lang/zh_CN/LC_MESSAGES', glob.glob('lang...
Python
# coding: utf-8 import os, sys import urllib, urlparse, httplib import socket, urllib2, time import shutil, zipfile, select import traceback, md5 import wx from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, \ ENOTCONN, ESHUTDOWN, EINTR, EISCONN, errorcode import version from ui import logfile, confi...
Python
# coding: utf-8 import os, sys, shutil, zipfile import version def win32_main(): f = open("youmoney.nsi", 'r') lines = f.readlines() f.close() f = open("youmoney.nsi.new", 'w') for line in lines: if line.startswith('OutFile'): f.write('OutFile "YouMoney-%s.exe"\...
Python
VERSION = "0.9.7"
Python
#!/usr/bin/python # coding: utf-8 # YouMoney is a opensource personal finance software # License: GPL # Author: zhaoweiakid <zhaoweikid@163.com> # 感谢 Jacky MA <jackyma1981@gmail.com> 制作的日文支持 import os, sys import threading, urllib, urllib2 import wx ver = int('%d%02d%02d' % wx.VERSION[:3]) if ver < 20809: print '...
Python
# coding: utf-8 import os, sys import youmoney youmoney.main()
Python
# coding: utf-8 import os, sys import json import traceback import socket import logfile, config conn = None class Request: def __init__(self, timeout=15): self.timeout = timeout self.addr = config.cf['server'].split(':') self.addr[0] = str(self.addr[0]) if len(self.addr) == 1: ...
Python
# coding: utf-8 import os, sys import socket import platform import json import traceback, subprocess import version import logfile, event, storage, netreq import wx def windows_version(): info = sys.getwindowsversion() verstr = '%d.%d.%d' % (info[3], info[0], info[1]) win_version = ...
Python
# coding: utf-8 import os, sys import wx import wx.html as html import datetime import logfile import datamodel import drawstat class StatPanel (wx.Panel): def __init__(self, parent, readydata): wx.Panel.__init__(self, parent, -1) self.parent = parent self.data = readydata ...
Python
# coding: utf-8 import os, sys import datetime, copy, types import pprint import wx import wx.lib.sized_controls as sc import wx.gizmos as gizmos import wx.lib.mixins.listctrl as listmix import logfile, statpanel, storage import datamodel class CategoryPanel (wx.Panel): def __init__(self, parent): wx.Panel...
Python
# coding: utf-8 import wx import os, string import types import math, copy def _ScaleBlit(bmp, dc, dst_rect): if bmp.GetWidth() == 0 or bmp.GetHeight() == 0: return sX = float(dst_rect.width) / float(bmp.GetWidth()) sY = float(dst_rect.height) / float(bmp.GetHeight()) dc.SetUserS...
Python
# coding: utf-8 import os, sys import sqlite3, locale, uuid import types, time import version createtable = ['create table if not exists category (id integer primary key autoincrement, name varchar(64) not null, parent integer default 0, type integer default 0)', 'create table if not exists capital (id ...
Python
# coding: utf-8 import os, sys import types, datetime import shutil logobj = None class LogFile: def __init__(self, filename, charset='utf-8'): self.charset = charset self.filename = filename if filename == 'stdout': self.file = sys.stdout else: ...
Python
# coding: utf-8 import os, sys import urlparse, time import hashlib, binascii import wx import urllib, urllib2, traceback import httplib, mimetypes import storage, config, rsa, logfile import base64, json, pickle, zlib, socket import config import logfile, storage, netreq def sumfile(filename): m = h...
Python
# conding: utf-8 import os, sys import sqlite3 import base64, pickle class Dropbox: def __init__(self): if sys.platform.startswith('win32'): userdir = os.environ['USERPROFILE'] self.dropboxfile = os.path.join(userdir, "Application Data", "Dropbox", "dropbox.db") ...
Python
# coding: utf-8 import os, sys import csv, datetime, time, types import storage from storage import catetypes, payways import datamodel class DataExport: def __init__(self, db, charset='utf-8'): self.db = db self.charset = charset self.catedbx = datamodel.CategoryData(self.db) ...
Python
import string import types ## json.py implements a JSON (http://json.org) reader and writer. ## Copyright (C) 2005 Patrick D. Logan ## Contact mailto:patrickdlogan@stardecisions.com ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser Genera...
Python
import wx, cStringIO import string, sys, os def load_bitmap(ipath): return wx.BitmapFromImage(wx.ImageFromStream(cStringIO.StringIO(open(ipath,'rb').read()))) def load_image(ipath): return wx.ImageFromStream(cStringIO.StringIO(open(ipath,'rb').read()))
Python
"""RSA module Module for calculating large primes, and RSA encryption, decryption, signing and verification. Includes generating public and private keys. """ __author__ = "Sybren Stuvel, Marloes de Boer and Ivo Tamboer" __date__ = "2009-01-22" # NOTE: Python's modulo can return negative numbers. We compensate for # ...
Python
# coding: utf-8 import os, sys import wx import wx.lib.newevent (UpdateNotifyEvent, EVT_UPDATE_NOTIFY) = wx.lib.newevent.NewEvent() (MyAlertEvent, EVT_MYALERT) = wx.lib.newevent.NewEvent()
Python
# coding: utf-8 import os, sys import storage import pprint import datetime, time class RecordCycle: def __init__(self, db): self.db = db self.checkfunc = {1:self.check_weekday, 2:self.check_weekend, 3:self.check_everyday, 4:self.check_weekly, 5:self.check_monthly} ...
Python
# coding: utf-8 import os, sys, copy, time import types, webbrowser, subprocess import wx import threading import panels, dialogs, config, storage, export, recycle, task, sync from wx.lib.wordwrap import wordwrap import event from loader import load_bitmap import sqlite3, datetime, shutil import datamodel import pprint...
Python
# coding: utf-8 import config, i18n
Python
# coding: utf-8 import os, sys import types import sqlite3 import logfile class DBDiff: def __init__(self, cate, newdbfile, olddbfile): self.cate = cate self.newdbfile = newdbfile self.olddbfile = olddbfile self.olddb = sqlite3.connect(olddbfile) self.newdb = sqlit...
Python
# coding: utf-8 import os, sys import datetime, time import pprint, types import logfile import storage class TreeNode: def __init__(self, parent, name, id): self.parent = parent self.name = name self.id = id self.childs = [] self.count = 0 #self.nu...
Python
# coding: utf-8 import os, sys import gettext def install(localdir, languages): gettext.translation('youmoney', localedir=localdir, languages=languages).install(True) def test(): install("../lang", ['zh_CN']) print _("hello") print _("me") if __name__ == '__main__': test() ...
Python
# coding: utf-8 import os, sys, string, re import wx import wx.lib.sized_controls as sc from wx.lib.mixins.listctrl import CheckListCtrlMixin import wx.lib.hyperlink as hl import urllib, urllib2, json import logfile, netreq class MySizedDialog(wx.Dialog): def __init__(self, *args, **kwargs): wx.Dialog....
Python
# coding: utf-8 import os, sys import socket, time import threading, traceback import Queue, SocketServer import wx import logfile, update, event, version # task: {'id':xx, 'type':xxx} taskq = Queue.Queue() server = None class Task (threading.Thread): def __init__(self): threading.Thread.__...
Python
# coding: utf-8 import os, sys import locale, time, version import types, pprint, uuid import base64, pickle #import rsa cf = None class Configure: def __init__(self, charset='utf-8'): self.rundir = os.path.dirname(os.path.abspath(sys.argv[0])) self.home = self.rundir #print '...
Python
#!/usr/bin/python # # Copyright (C) 2012 Google Inc. # # 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 ...
Python
#!/usr/bin/python # # Copyright (C) 2012 Google Inc. # # 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 ...
Python
#!/usr/bin/env python # # Copyright (c) 2002, Google Inc. # 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, this ...
Python
#!/usr/bin/env python # Copyright (c) 2010, Google Inc. # 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, this l...
Python
# Copyright (C) 2010 Google Inc. # # 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 agreed to in writ...
Python
#!/usr/bin/python2.4 # -*- coding: utf-8 -*- # # Copyright (C) 2011 Google Inc. # # 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 ...
Python
# Copyright 2011 Google Inc. All Rights Reserved. """Locked file interface that should work on Unix and Windows pythons. This module first tries to use fcntl locking to ensure serialized access to a file, then falls back on a lock file if that is unavialable. Usage: f = LockedFile('filename', 'r+b', 'rb') f....
Python
# Copyright 2011 Google Inc. All Rights Reserved. """Multi-credential file store with lock support. This module implements a JSON credential store where multiple credentials can be stored in one file. That file supports locking both in a single process and across processes. The credential themselves are keyed off o...
Python
# Copyright (C) 2010 Google Inc. # # 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 agreed to in writ...
Python
# Copyright (C) 2010 Google Inc. # # 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 agreed to in writ...
Python
# Copyright (C) 2010 Google Inc. # # 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 agreed to in writ...
Python
# Copyright (C) 2011 Google Inc. # # 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 agreed to in writ...
Python
# Copyright (C) 2010 Google Inc. # # 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 agreed to in writ...
Python
__version__ = "1.0c2"
Python
# Copyright (C) 2010 Google Inc. # # 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 agreed to in writ...
Python
# Copyright (C) 2012 Google Inc. # # 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 agreed to in writ...
Python
# Copyright (C) 2007 Joe Gregorio # # Licensed under the MIT License """MIME-Type Parser This module provides basic functions for handling mime-types. It can handle matching mime-types against a list of media-ranges. See section 14.1 of the HTTP specification [RFC 2616] for a complete explanation. http://www.w3.o...
Python
# Copyright (C) 2010 Google Inc. # # 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 agreed to in writ...
Python
# Copyright (C) 2010 Google Inc. # # 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 agreed to in writ...
Python
# Copyright (C) 2010 Google Inc. # # 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 agreed to in writ...
Python
# Copyright (C) 2010 Google Inc. # # 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 agreed to in writ...
Python
# Copyright (C) 2010 Google Inc. # # 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 agreed to in writ...
Python
# Copyright (C) 2010 Google Inc. # # 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 agreed to in writ...
Python
# Copyright (C) 2010 Google Inc. # # 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 agreed to in writ...
Python
# Copyright (C) 2010 Google Inc. # # 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 agreed to in writ...
Python
__version__ = "1.0c2"
Python
#!/usr/bin/python2.4 # # Copyright (C) 2010 Google Inc. # # 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 l...
Python
#!/usr/bin/python2.4 # # Copyright (C) 2010 Google Inc. # # 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 l...
Python
""" iri2uri Converts an IRI to a URI. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright 2006, Joe Gregorio" __contributors__ = [] __version__ = "1.0.0" __license__ = "MIT" __history__ = """ """ import urlparse # Convert an IRI to a URI following the rules in RFC 3987 # # The characte...
Python
from __future__ import generators """ httplib2 A caching http interface that supports ETags and gzip to conserve bandwidth. Requires Python 2.3 or later Changelog: 2007-08-18, Rick: Modified so it's able to use a socks proxy if needed. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright...
Python
"""SocksiPy - Python SOCKS module. Version 1.00 Copyright 2006 Dan-Haim. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this ...
Python
import Cookie import datetime import time import email.utils import calendar import base64 import hashlib import hmac import re import logging # Ripped from the Tornado Framework's web.py # http://github.com/facebook/tornado/commit/39ac6d169a36a54bb1f6b9bf1fdebb5c9da96e09 # # Tornado is licensed under the Apache Licen...
Python
# This is the version of this source code. manual_verstr = "1.5" auto_build_num = "211" verstr = manual_verstr + "." + auto_build_num try: from pyutil.version_class import Version as pyutil_Version __version__ = pyutil_Version(verstr) except (ImportError, ValueError): # Maybe there is no pyutil insta...
Python
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel 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 Software without restriction, including without limitation the ...
Python
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel 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 Software without restriction, including without limitation the ...
Python
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel 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 Software without restriction, including without limitation the ...
Python
# Early, and incomplete implementation of -04. # import re import urllib RESERVED = ":/?#[]@!$&'()*+,;=" OPERATOR = "+./;?|!@" EXPLODE = "*+" MODIFIER = ":^" TEMPLATE = re.compile(r"{(?P<operator>[\+\./;\?|!@])?(?P<varlist>[^}]+)}", re.UNICODE) VAR = re.compile(r"^(?P<varname>[^=\+\*:\^]+)((?P<explode>[\+\*])|(?P<part...
Python
#!/usr/bin/python import socket import sys def print_help(): print "Usage: listener.py <HOST> <PORT>" print " HOST - ip address of local host" print " PORT - local port number" if __name__ == "__main__": if len(sys.argv) < 3: print_help() exit(1) LHOST = sys.argv[1] LPORT = int( sys.argv[2] ) sock =...
Python