code
stringlengths
1
1.72M
language
stringclasses
1 value
#Prueba de Puertos Con clase from Ports import Ports Puertos = Ports("PortConf.cf","Constantes.cf") Puertos.SetPortConfig("PORT00","input") Puertos.SetPortConfig("PORT01","input") Puertos.SetPortConfig("PORT02","input") Puertos.SetPortConfig("PORT03","output") Puertos.SetPortConfig("PORT04","undef") Puertos.SetPortCon...
Python
import subprocess import re import sys import time import datetime class Sensor: def __init__(self,N_sensor,N_pin): self.Senc = str(N_sensor).strip() self.Pin = str(N_pin).strip() #print self.Senc,self.Pin def Obtener_Datos(self): cadena = "sudo ./Adafruit_DHT "+str(self.Senc)+" "+str(self.Pin.strip()) ...
Python
#Constantes PORT00 = 8 PORT01 = 10 PORT02 = 12 PORT03 = 16 PORT04 = 3 PORT05 = 5 PORT06 = 7 PORT07 = 11 PORT08 = 13 PORT09 = 15 PORT10 = 19 PORT11 = 21 PORT12 = 23 PORT13 = 18 PORT14 = 22 PORT15 = 24 PORT16 = 26 DHT11 = 11 DHT22 = 22 sarasa
Python
#Configurator #Este Modulo se encarga de leer y escribir las lineas del archivo #De Configuracion class Configurator: def __init__(self,ConfigFile): self.ArchivoConfiguracion = ConfigFile def CrearArchivoDefault(self): self.__NuevoArchivoConfig() def GetIpAddress(self): return self.__BuscarParmetro("IPAd...
Python
# 2013/5/1 version beta 0.6.4.9 import RPi.GPIO as GPIO GPIO.cleanup() GPIO.setmode(GPIO.BCM) GPIO.setup(27,GPIO.OUT) GPIO.setup(22,GPIO.OUT) GPIO.setup(10,GPIO.OUT) GPIO.setup(9,GPIO.OUT) GPIO.setup(11,GPIO.OUT) GPIO.setup(24,GPIO.OUT) GPIO.setup(25,GPIO.OUT) GPIO.setup(8,GPIO.OUT) #s = raw_input('--> ') while ...
Python
#Ports #Imports #import RPi.GPIO as GPIO class Ports: def __init__(self,ConfigFile,ConstFile): self.ArchivoConfiguracion = ConfigFile self.ArchivoConstantes = ConstFile GPIO.setmode(GPIO.BCM) #Setea el puerto como entrada o salida def SetPortConfig(self,Port,Type): GPIO.setup(int(Port.strip()),GPIO.OUT) ...
Python
#Firmware Raspberry #Imports import time from datetime import datetime from Constantes import * from Configurator import Configurator from Sensor import Sensor from Database import Database from Ports import Ports from Script import Script import thread #Startup Por = Ports("PortConf.cf","Constantes.cf") Sen = Sensor...
Python
#Networking Class import os import socket import fcntl import struct import sys class Networking: def __init__(self,interface): self.Interface = interface self.SIOCGIFNETMASK = 0x891b self.SIOCGIFADDR = 0x8915 def GetIPAddress(self): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) return socket.ine...
Python
#Metodos De Acceso a la base de datos import sqlite3 import sys import os from datetime import datetime class Database: def __init__(self,BaseDeDatos): self.DB = sqlite3.connect(BaseDeDatos) self.Cursor = self.DB.cursor() def InsertarMedicion(self, Temperatura, Humedad, Fecha): FechaFormateada = Fecha.s...
Python
#!/usr/bin/python import os from urllib import urlopen from bs4 import BeautifulSoup output_dir = os.path.abspath('../assets/help') assert os.path.exists(output_dir) files_list_images = [] files_list_html = [ 'Manual', 'FAQ', 'StylusSupport', 'SupportedDevices', 'Permissions' ] def download_r...
Python
### ## * << Haru Free PDF Library 2.0.8 >> -- hpdf_consts.h ## * ## * URL http://libharu.org/ ## * ## * Copyright (c) 1999-2006 Takeshi Kanno ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that...
Python
### ## * << Haru Free PDF Library 2.0.3 >> -- hpdf_types.h ## * ## * URL http://libharu.org/ ## * ## * Copyright (c) 1999-2006 Takeshi Kanno ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that ...
Python
error_detail={ 0x1001: 'Internal error. The consistency of the data was lost.', 0x1002: 'Internal error. The consistency of the data was lost.', 0x1003: 'Internal error. The consistency of the data was lost.', 0x1004: 'The length of the data exceeds HPDF_LIMIT_MAX_STRING_LEN.', 0x1005: 'Cannot get a pallet dat...
Python
def printf(format, *optional): #print 'format="%s"' % format #print 'optional="%s"' % optional if len(optional)==1: optional=optional[0] if format.endswith('\n'): format=format[:-1] print format % optional
Python
## ## * << Haru Free PDF Library 2.0.8 >> -- hpdf.h ## * ## * URL http://libharu.org/ ## * ## * Copyright (c) 1999-2006 Takeshi Kanno ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the abo...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- png_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the ab...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- permission.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the ...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- grid_sheet.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the ...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- ttfont_demo_jp.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that ...
Python
#coding=ISO8859-2 ### ## * << Haru Free PDF Library 2.0.0 >> -- outline_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- jpfont_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- encryption.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the ...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- ext_gstate_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- raw_image_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that ...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- jpeg_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the a...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- outline_demo_jp.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- text_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the a...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- font_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the a...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- encoding_list.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that t...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- ttfont_demo_jp.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that ...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- chfont_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- jpfont_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- image_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the ...
Python
### ## * << Haru Free PDF Library 2.0.6 >> -- slideshow_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that ...
Python
#coding=utf-8 ### ## * << Haru Free PDF Library 2.0.0 >> -- text_annotation.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ##...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- character_map.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that t...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- line_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the a...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- ttfont_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- arc_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the ab...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- make_rawimage.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that t...
Python
### ## * << Alternative PDF Library 1.0.0 >> -- text_demo2.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that th...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- link_annotation.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that...
Python
# Django settings for Project project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Dawid Cech', 'dawid.cech@gmail.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'sqlite3', 'NAME': 'Project.db', } } EXAMPLE_DATABASES = { 'default': { ...
Python
from django.db import models from mptt.models import MPTTModel from django.contrib.auth.models import User from django.template.defaultfilters import slugify class ItemType(MPTTModel): name = models.CharField(max_length=200) slug = models.SlugField(editable=False) parent = models.ForeignKey('sel...
Python
from django.core.paginator import Paginator, InvalidPage, EmptyPage def pagination_helper(request, objects): paginator = Paginator(objects, 5) # Show 25 contacts per page # Make sure page request is an int. If not, deliver first page. try: page = int(request.GET.get('page', '1')) except ...
Python
""" This file demonstrates two different styles of tests (one doctest and one unittest). These will both pass when you run "manage.py test". Replace these with more appropriate tests for your application. """ from django.test import TestCase class SimpleTest(TestCase): def test_basic_addition(self): ...
Python
import re, sys from django import template register = template.Library() @register.filter(name='pluralize') def pluralize(value): """Polish implementation""" try: if int(value) in (12,13,14): return 'ów' elif int(value)%10 in (2,3,4): return 'y' e...
Python
from django.shortcuts import render_to_response from myapp.models import Announcement, Location, User, AnnouncementForm from django.contrib.auth.decorators import login_required from myapp.helpers import * from django.shortcuts import redirect from datetime import * # Create your views here. def index(request)...
Python
from myapp.models import ItemType, Item, QuantityType, Activity, Step, Tool, Recipe from django.contrib import admin admin.site.register(ItemType) admin.site.register(Item) admin.site.register(QuantityType) admin.site.register(Activity) admin.site.register(Step) admin.site.register(Tool) admin.site.register(R...
Python
#!/usr/bin/env python from django.core.management import execute_manager try: import settings # Assumed to be in the same directory. except ImportError: import sys sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll ha...
Python
from django.conf.urls.defaults import * from django.contrib import databrowse # from myapp.models import Announcement, Location # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Example: # (r'^Project/', include('P...
Python
#!/usr/bin/env python from django.core.management import execute_manager try: import settings # Assumed to be in the same directory. except ImportError: import sys sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll ha...
Python
# Django settings for Project project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Dawid Cech', 'dawid.cech@gmail.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'sqlite3', 'NAME': 'Project.db', } } EXAMPLE_DATABASES = { 'default': { ...
Python
from django.db import models from mptt.models import MPTTModel from django.contrib.auth.models import User from django.template.defaultfilters import slugify from django.forms import ModelForm, Textarea from slughifi import * class Location(MPTTModel): #LOCATION_CHOICES=(('U','Uczelnia'),('S','Szkola'),...
Python
from django.core.paginator import Paginator, InvalidPage, EmptyPage def pagination_helper(request, objects): paginator = Paginator(objects, 5) # Show 25 contacts per page # Make sure page request is an int. If not, deliver first page. try: page = int(request.GET.get('page', '1')) except ...
Python
""" This file demonstrates two different styles of tests (one doctest and one unittest). These will both pass when you run "manage.py test". Replace these with more appropriate tests for your application. """ from django.test import TestCase class SimpleTest(TestCase): def test_basic_addition(self): ...
Python
import re, sys from django import template register = template.Library() @register.filter(name='pluralize') def pluralize(value): """Polish implementation""" try: if int(value) in (12,13,14): return 'ów' elif int(value)%10 in (2,3,4): return 'y' e...
Python
from django.shortcuts import render_to_response from myapp.models import Announcement, Location, User, AnnouncementForm from django.contrib.auth.decorators import login_required from myapp.helpers import * from django.shortcuts import redirect from datetime import * from django.db.models import Count, Max # Cr...
Python
from myapp.models import Announcement, Location from django.contrib import admin admin.site.register(Announcement) admin.site.register(Location)
Python
#!/usr/bin/env python from django.core.management import execute_manager try: import settings # Assumed to be in the same directory. except ImportError: import sys sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll ha...
Python
from django.conf.urls.defaults import * from django.contrib import databrowse from myapp.models import Announcement, Location # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Example: # (r'^Project/', include('Pro...
Python
#!/usr/bin/env python from django.core.management import execute_manager try: import settings # Assumed to be in the same directory. except ImportError: import sys sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll ha...
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/python2.6 # # Copyright 2011 Eric Gavaletz <gavaletz@gmail.com> # 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/LICENS...
Python
#!/usr/bin/python2.6 # # Copyright 2011 Eric Gavaletz <gavaletz@gmail.com> # 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/LICENS...
Python
#!/usr/bin/python2.6 # # Copyright 2011 Eric Gavaletz <gavaletz@gmail.com> # 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/LICENS...
Python
#!/usr/bin/python2.6 # # Copyright 2011 Eric Gavaletz <gavaletz@gmail.com> # 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/LICENS...
Python
#!/usr/bin/python2.6 # # Copyright 2011 Eric Gavaletz <gavaletz@gmail.com> # 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/LICENS...
Python
#!/usr/bin/env python """Universal feed parser Handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom 0.3, and Atom 1.0 feeds Visit http://feedparser.org/ for the latest version Visit http://feedparser.org/docs/ for the latest documentation Required: Python 2.1 or later Recommended: Python 2.3 or later Recommended: CJKCodecs...
Python
import sys import os import xbmc import xbmcgui import urllib import feedparser import socket _ = sys.modules[ "__main__" ].__language__ __scriptname__ = sys.modules[ "__main__" ].__scriptname__ __version__ = sys.modules[ "__main__" ].__version__ __addon__ = sys.modules[ "__main__" ].__addon__ _U...
Python
import os import sys import xbmcaddon __author__ = "amet" __scriptid__ = "script.gmail.checker" __scriptname__ = "GmailChecker" __addon__ = xbmcaddon.Addon(id=__scriptid__) __cwd__ = __addon__.getAddonInfo('path') __version__ = __addon__.getAddonInfo('version') __language__ = __addon__.getLoc...
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 # # 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
"""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
""" 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
""" 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
# 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
# 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 (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 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
__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) 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 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 (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) 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