code
stringlengths
1
1.72M
language
stringclasses
1 value
from meshUtils import * #end
Python
import os import sys from api import mel from maya.cmds import * from filesystem import Path, removeDupes, BreakException, getArgDefault from vectors import Vector import maya.cmds as cmd import filesystem import rigUtils import triggered import colours import meshUtils import profileDecorators from ...
Python
from baseMelUI import * from apiExtensions import iterParents from melUtils import mel, melecho import maya.cmds as cmd import mappingEditor import mappingUtils import xferAnim import animLib __author__ = 'mel@macaronikazoo.com' class XferAnimForm(MelVSingleStretchLayout): def __init__( self, paren...
Python
import maya.mel from maya.cmds import cmd melEval = maya.mel.eval def pyArgToMelArg( arg ): #given a python arg, this method will attempt to convert it to a mel arg string if isinstance( arg, basestring ): return u'"%s"' % cmd.encodeString( arg ) #if the object is iterable then turn it into a mel array strin...
Python
from baseSkeletonBuilder import * class ArbitraryChain(SkeletonPart): HAS_PARITY = False @classmethod def _build( cls, parent=None, partName='', jointCount=5, direction='-z', **kw ): if not partName: partName = cls.__name__ idx = Parity( kw[ 'idx' ] ) partScale = kw[ 'partScale' ] par...
Python
from maya.OpenMaya import * from vectors import Vector, Matrix import sys import maya.cmds as cmd import time getAttr = cmd.getAttr setAttr = cmd.setAttr MObject.__MPlug__ = None def asMObject( otherMobject ): ''' tries to cast the given obj to an mobject - it can be string ''' if isinstance...
Python
from baseSkeletonBuilder import * class Arm(SkeletonPart): HAS_PARITY = True @classmethod def _build( cls, parent=None, buildClavicle=True, **kw ): idx = Parity( kw[ 'idx' ] ) partScale = kw[ 'partScale' ] parent = getParent( parent ) allJoints = [] dirMult = idx.asMultiplier() pari...
Python
def trackableTypeFactory( metaclassSuper=type ): ''' returns a metaclass that will track subclasses. All classes of the type returned by this factory will have the following class methods implemented: IterSubclasses() GetSubclasses() GetNamedSubclass( name ) usage: class SomeClass( metaclass=...
Python
import cProfile as prof import pstats import os import time def d_profile(f): ''' writes out profiling info on the decorated function. the profile results are dumped in a file called something like "_profile__<moduleName>.<functionName>.txt" ''' def newFunc( *a, **kw ): def run(): f( *a, **kw ) ...
Python
import sys import skeletonBuilder import baseRigPrimitive from filesystem import Path from skeletonBuilder import * from baseRigPrimitive import * __author__ = 'hamish@macaronikazoo.com' RIG_PART_SCRIPT_PREFIX = 'rigPrim_' ### !!! DO NOT IMPORT RIG SCRIPTS BELOW THIS LINE !!! ### def _iterRigPa...
Python
from baseSkeletonBuilder import * class Spine(SkeletonPart): HAS_PARITY = False @classmethod def _build( cls, parent=None, count=3, direction='y', **kw ): idx = kw[ 'idx' ] partScale = kw[ 'partScale' ] parent = getParent( parent ) directionAxis = Axis.FromName( direction ) allJoints =...
Python
from typeFactories import interfaceTypeFactory from baseRigPrimitive import * from apiExtensions import cmpNodes ARM_NAMING_SCHEME = 'arm', 'bicep', 'elbow', 'wrist' LEG_NAMING_SCHEME = 'leg', 'thigh', 'knee', 'ankle' class SwitchableMixin(object): ''' NOTE: we can't make this an interface class becaus...
Python
from filesystem import Path import os import sys import dependencies import api import maya import baseMelUI import maya.cmds as cmd def flush(): pluginPaths = map( Path, api.mel.eval( 'getenv MAYA_PLUG_IN_PATH' ).split( ';' ) ) #NOTE: os.environ is different from the getenv call, and getenv isn'...
Python
from baseMelUI import * from filesystem import Path, Callback from common import printWarningStr import api, presetsUI PRESET_ID_STR = 'zoo' PRESET_EXTENSION = 'filter' class FileScrollList(MelObjectScrollList): def __init__( self, parent, *a, **kw ): self._rootDir = None self._displayRelativeTo...
Python
from vectors import * from filesystem import Path, resolvePath, writeExportDict import time, datetime, names, filesystem TOOL_NAME = 'weightSaver' TOOL_VERSION = 2 DEFAULT_PATH = Path('%TEMP%/temp_skin.weights') TOL = 0.25 EXTENSION = 'weights' _MAX_RECURSE = 35 class SkinWeightException(Exceptio...
Python
from devTest import Path, TestCase from maya import cmds as cmd TEST_DIRECTORY = Path( __file__ ).up() / '_devTest_testScenes_' #location for maya files written by tests def d_makeNewScene( sceneName ): ''' simple decorator macro - will create a new scene and save it so that it exists on disk before t...
Python
''' this script contains a bunch of useful poly mesh functionality. at this stage its not really much more than a bunch of functional scripts - there hasn't been any attempt to objectify any of this stuff yet. as it grows it may make sense to step back a bit and think about how to design this a little better '''...
Python
''' super simple vector class and vector functionality. i wrote this simply because i couldn't find anything that was easily accessible and quick to write. this may just go away if something more comprehensive/mature is found ''' import re import math import random from math import cos, sin, tan, acos, asin...
Python
from maya.cmds import * import re import time import api import maya.cmds as cmd mel = api.mel melecho = api.melecho def resolveCmdStr( cmdStr, obj, connects, optionals=[] ): ''' NOTE: both triggered and xferAnim use this function to resolve command strings as well ''' INVALID = '<invalid con...
Python
from baseMelUI import * from filesystem import Path import maya.cmds as cmd import poseSym import os LabelledIconButton = labelledUIClassFactory( MelIconButton ) class PoseSymLayout(MelVSingleStretchLayout): ICONS = ICON_SWAP, ICON_MIRROR, ICON_MATCH = 'poseSym_swap.xpm', 'poseSym_mirror.xpm', 'pose...
Python
from baseMelUI import * from maya.mel import eval as evalMel from filesystem import Path from common import printErrorStr import re import maya try: #try to connect to wing - otherwise don't worry import wingdbstub except ImportError: pass def setupDagProcMenu(): ''' sets up the modifications ...
Python
import maya.cmds as cmd class KeyServer(object): ''' This class is basically an iterator over keys set on the given objects. Key times are iterated over in chronological order. Calling getNodes on the iterator will provide a list of nodes that have keys on the current frame ''' def __init__( self, nodes, cha...
Python
from data import * def themeTest(): print "I am the default theme!" def setFont(obj): obj.setFont("Devinne Swash", 16) def addPythonButton(gump, coordinates, callback): b = gump.addPythonButton(coordinates, Texture(TextureSource.THEME, "images/button.png"), callback) styleButton(b) return b def...
Python
from data import * def themeTest(): print "I am the preshard theme!" def setFont(obj): obj.setFont("Devinne Swash", 16) def addPythonButton(gump, coordinates, callback): b = gump.addPythonButton(coordinates, Texture(TextureSource.THEME, "images/button.png"), callback) styleButton(b) return b de...
Python
from data import * from ui import * import client import theme # In case you want to redesign this gump, keep in mind that at this point, you can not # access any uo data (e.g. art.mul graphics, hues), as the mul files are not loaded yet. def create(args): g = GumpMenu("shardlist", 400, 300) g.closable = Fals...
Python
from data import * from ui import * import client import theme def create(args): g = GumpMenu("serverlist", 400, 300) g.closable = False print args serverList = args["serverlist"] # serverlist is a list of tuples (index, name) if len(serverList) > 0: g.onEnter = selectFirst g...
Python
from ui import * from data import * import world def create(args): g = GumpMenu("profile", args.get("x", 100), args.get("y", 100)) g.mobile = args["mobile"] # TODO: make this look like the uo one g.addImage((0, 0), Texture(TextureSource.THEME, "images/background_250x250.png")) # TODO: editable f...
Python
from ui import * from data import * def init(gump): gump.setFont("unifont1", 12, False) def addHtmlBackground(gump, geom): return gump.addBackground(geom, 3000) def addHtmlScrollbar(gump, geom): scroll = gump.addScrollArea(geom) scroll.marginLeft = 3 scroll.marginTop = 3 scroll.marginRight =...
Python
# -*- coding: utf-8 -*- from ui import * from data import * import time def onButtonClick(button): print "onButtonClick" button.rgba = (1.0, 0.0, 1.0) print button.name button.halign = HAlign.RIGHT button.valign = VAlign.TOP button.gump.component("i1").hue = 90 print button.gump.store print button.gump.sto...
Python
from ui import * from data import * import client import theme def create(args): g = GumpMenu("login", 387, 320) g.setFont("Devinne Swash", 16) g.onEnter = onGumpEnter g.onEscape = onGumpEscape g.addImage((0, 0), Texture(TextureSource.THEME, "images/background_250x125.png")) label = g.addLab...
Python
from ui import * from data import * import theme import client import world def create(args): g = GumpMenu("skills", args.get("x", 100), args.get("y", 100)) g.mobile = args["mobile"] g.onPropertyUpdate = updateSkillValues g.addBackground((0, 0, 400, 400), 3000) scroll = theme.addScrollArea(g, (5,...
Python
from ui import * from data import * import client import theme #In case you want to redesign this gump, keep in mind that at this point, you can not #access any uo data (e.g. art.mul graphics, hues), as the mul files are not loaded yet. def create(args): g = GumpMenu("createshard", 400, 300) g.draggable = Fal...
Python
import ui from data import * import world # mapping between the id sent by the server and the id in gumpart.mul BUFF_ICONS = { 0x3e9: 0x754C, 0x3ea: 0x754A, 0x3ed: 0x755E, 0x3ee: 0x7549, 0x3ef: 0x7551, 0x3f0: 0x7556, 0x3f1: 0x753A, 0x3f2: 0x754D, 0x3f3: 0x754E, 0x3f4: 0x7565, ...
Python
from ui import * from data import * import client def create(args): g = GumpMenu("gamewindow", args.get("x", 20), args.get("y", 20), True) g.closable = False g.onEnter = showSpeechEntry width = args.get("width", 800) height = args.get("height", 600) g.addPage(0) g.addBackground((0, 0, wi...
Python
import ui from data import Texture, TextureSource, rgba import client def create(args): g = ui.GumpMenu("spellbook", 100, 100) g.setFont("Devinne Swash", 16) g.addPage(0) g.addImage((0, 0), Texture(TextureSource.GUMPART, 2220)) # circle numbers g.addPageButton((58, 175), Texture(TextureSourc...
Python
from ui import * from data import * import client import world def create(args): g = GumpMenu("paperdoll", args.get("x", 50), args.get("y", 50)) g.mobile = args["mobile"] g.onWarmodeChanged = onWarmodeChanged g.addImage((0, 0), Texture(TextureSource.GUMPART, 2000)) g.addPaperdollView((3, 9, 240, ...
Python
import ui import theme import client import data def create(args): g = ui.GumpMenu("objectpropertylist", args["x"], args["y"]) g.draggable = False g.closable = False g.addBackground((0, 0, 250, len(args["lines"]) * 16 + 10), 3000) y = 5 # lines is a list of strings for cur in args["lines...
Python
import ui import theme import client import data def create(args): g = ui.GumpMenu("contextmenu", 50, 50) g.draggable = False g.store["serial"] = args["serial"] y = 0 # entries is a list of tuples # (entry id, cliloc id) for cur in args["entries"]: bt = theme.addPythonButton(g, (...
Python
from ui import * from data import * import world def create(args): g = GumpMenu("status", args.get("x", 100), args.get("y", 100)) g.mobile = args["mobile"] if g.mobile == world.getPlayer(): g.addImage((0, 0), Texture(TextureSource.GUMPART, 10860)) l = g.addPropertyLabel((83, 45, 295, 20),...
Python
import ui from data import Texture, TextureSource import client import theme def create(args): g = ui.GumpMenu("yesnobox", 300, 300) g.onEnter = choiceYes g.onEscape = choiceNo g.store["callbackYes"] = args["callbackYes"] g.store["callbackNo"] = args["callbackNo"] g.store["callbackArgs"] = arg...
Python
from world import * from ui import * from data import * import client import theme def create(args): g = GumpMenu("login", 337, 289, True) theme.setFont(g) g.closable = False g.addImage((0, 0), Texture(TextureSource.THEME, "images/background_350x190.png")) g.addLabel((15, 16), "IP/Hostname:") ...
Python
from data import * from ui import * import client import theme def create(args): g = GumpMenu("characterlist", 400, 300) g.closable = False charList = args["characterlist"] # characterlist is a list of tuples (index, name, password) if len(charList) > 0: g.onEnter = selectFirst g....
Python
import ui import world def create(args): g = ui.GumpMenu("container", args.get("x", 100), args.get("y", 100)) cont = g.addContainerView((0, 0), args["item"]) cont.background = args["background"] g.store["serial"] = args["item"].serial g.store["background"] = args["background"] def save(gump): ...
Python
from ui import * from data import * import client def create(args): g = GumpMenu("minimap", args.get("x", 120), args.get("y", 120)) width = args.get("width", 300) height = args.get("height", 300) g.addBackground((0, 0, width + 6, height + 6), 2620) mmv = g.addMiniMapView((3, 3, width, height)) ...
Python
# this gump is opened after receiving packet 0x7C and can be either # just a question or a gump to pick an item from ui import * from data import * import client import theme def create(args): g = GumpMenu("", 250, 150) g.store["serial"] = args["serial"] # to be included in the response g.store["menuid"]...
Python
#!/usr/bin/python2.6 # # Simple http server to emulate api.playfoursquare.com import logging import shutil import sys import urlparse import SimpleHTTPServer import BaseHTTPServer class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): """Handle playfoursquare.com requests, for testing.""" def do_GET(self...
Python
#!/usr/bin/python """ Pull a oAuth protected page from foursquare. Expects ~/.oget to contain (one on each line): CONSUMER_KEY CONSUMER_KEY_SECRET USERNAME PASSWORD Don't forget to chmod 600 the file! """ import httplib import os import re import sys import urllib import urllib2 import urlparse import user from xml....
Python
#!/usr/bin/python import logging from xml.dom import minidom from xml.dom import pulldom BOOLEAN = "boolean" STRING = "String" GROUP = "Group" # Interfaces that all FoursquareTypes implement. DEFAULT_INTERFACES = ['FoursquareType'] # Interfaces that specific FoursqureTypes implement. INTERFACES = { } DEFAULT_CLA...
Python
#!/usr/bin/python import datetime import sys import textwrap import common from xml.dom import pulldom PARSER = """\ /** * Copyright 2009 Joe LaPenna */ package com.joelapenna.foursquare.parsers; import com.joelapenna.foursquare.Foursquare; import com.joelapenna.foursquare.error.FoursquareError; import com.joel...
Python
#!/usr/bin/python import os import subprocess import sys BASEDIR = '../main/src/com/joelapenna/foursquare' TYPESDIR = '../captures/types/v1' captures = sys.argv[1:] if not captures: captures = os.listdir(TYPESDIR) for f in captures: basename = f.split('.')[0] javaname = ''.join([c.capitalize() for c in basena...
Python
from django.db import models
Python
# Create your views here.
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 have to ...
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 have to ...
Python
from django.conf.urls.defaults import * urlpatterns = patterns('', # Example: # (r'^fluidmeets/', include('fluidmeets.foo.urls')), # Uncomment this for admin: (r'^admin/', include('django.contrib.admin.urls')), )
Python
# Django settings for fluidmeets project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ('Sebastian Castillo Builes', 'castillobuiles@gmail.com'), ('Rafael S. Gonzalez D\'Leon', 'rafaeldleon@gmail.com'), ) MANAGERS = ADMINS DATABASE_ENGINE = 'sqlite3' ...
Python
#!/usr/bin/env python import errno import os import pexpect import re import string import threading import time import pygtk import gobject import gtk import gtk.glade class UnisonProfile: treestore = gtk.ListStore(str) def __init__(self): self.treestore.append(['fluence-test']) pass ...
Python
#!/usr/bin/env python import errno import os import pexpect import re import string import threading import time import pygtk import gobject import gtk import gtk.glade class UnisonProfile: treestore = gtk.ListStore(str) def __init__(self): self.treestore.append(['fluence-test']) pass ...
Python
#!/usr/bin/python """ File: manager.py ICS 413 Project Description: the Basic function of a schleduing calendar. A note on the dateList Structure: dateList[0] is the tuple of the first day. dateList[0][0] is the actual date value of the first day. (DateTuples) dateList[0][1] is the event list of the first day. (DateT...
Python
#!/usr/bin/python """ File: manager.py ICS 413 Project Description: the Basic function of a schleduing calendar. A note on the dateList Structure: dateList[0] is the tuple of the first day. dateList[0][0] is the actual date value of the first day. (DateTuples) dateList[0][1] is the event list of the first day. (DateT...
Python
import FonctionSetCover as F import Producteur as P import Set as S import Consommateur as C TabClient=[] TabProd=[] TabProd.append(P.Producteur("P1","Belleville-sur-Loire",47.506113,2.851424,30.9,1122612,0,10)) TabProd.append(P.Producteur("P2","Braud-et-Saint-Louis",45.248611,-0.623889,30.9,979534,0,10)) TabProd.app...
Python
#!/usr/bin/python3.2 # -*-coding:utf-8 -* import Consommateur import Producteur from FonctionSetCover import * """ il faudra via les modules qui seront mises en place remplir TabProd & TabClient """ TabClient=[] TabProd=[] TabProd.append(Producteur("P1","Rhône-Alpes",45,5,30.9,1122612,0,"NUCLEAR")) TabProd.append(Pr...
Python
import networkx as nx import matplotlib.pyplot as plt class Map: # constantes latitude_min = 42.19 latitude_max = 51.5 longitude_min = 4.46 longitude_max = 8.14 def Draw (sets, filename): G = nx.Graph () position = {} # Building graphs for selection in sets : G.add_node (selection...
Python
import FonctionSetCover as F import Producteur as P import Set as S import Consommateur as C TabClient=[] TabProd=[] TabProd.append(P.Producteur("P1","Rhone-Alpes",45,5,30.9,1122612,0,10)) TabProd.append(P.Producteur("P2","Centre",47,1,30.9,979534,0,10)) TabProd.append(P.Producteur("P3","Haute-Normandie",49,0,30.9,66...
Python
class Producteur: """ Cette classe contient toutes les informations de la strucuture producteur - name - region - latitude - longitude - cmwh // cost to product 1Mw/h - pmax //Puissance nominale max en Mw/h - pmin //Puissance nomilane min en Mw/h ...
Python
class Consommateur: """ Cette classe contient toutes les informations de la strucuture consommateur - name - region - latitude - longitude - population - needs // nbr de MegaWatt/h minimal necessaire """ key=-1 def __init__(se...
Python
from __future__ import nested_scopes import Consommateur as C import Producteur as P import Set as S from math import * import numpy as np import scipy.optimize as s import random as r """Resultat en metre Distance(Producteur p, Consommateur c""" d=[[56.0921545309,412.902036059,297.5333736374,285.2234197985,229.09782...
Python
import FonctionSetCover as F class Set: """ Cette classe permet de construire des regroupements entre un Producteur et des clients potentiels. - Producteur (-index) -Consommateur[] -Cout global// qui compte l'approvisionnement des centrales + la mise en route a definir plus en detail. """ ...
Python
#!/usr/bin/env python # Current Cost Envir logger # Grabs Main Electricity, temperature and remote units # code located on http://code.google.com/p/my-jog-home # created from reference: http://naxxfish.eu/2012/electricity-usage-logging-with-currentcost-envir-and-a-raspberry-pi/ import sys sys.path.append('../xap') sy...
Python
#!/usr/bin/env python # Water Solar Collector Readings Logger # Grabs information from the vbus console and post xap to the Network # code located on http://code.google.com/p/my-jog-home # reference code for vbusdecode from http://code.google.com/p/vbusdecode/ # reference code for hah/xap from http://code.googl...
Python
# # # # import serial from struct import pack import time import sys import os sys.path.append('../xap') from xaplib import Xap from stats_defn import * from hm_constants import * from hm_utils import * # these will be crated as an array # def SetxAPNodeTemp(temperature, serport, xap, holdtime=0): # def SetNod...
Python
import sys import signal import serial from time import localtime, strftime, sleep import binascii import subprocess # thread mutexs serialmutex=0 xapmutex=0 class TimeoutException(Exception): pass # use the mutex variable to control access to the serial portdef obtainMutexSerialAccess(): def obtainMutexSeria...
Python
# # Ian Shaw 2012 # # Based on code set from Neil Trimboy (http://code.google.com/p/heatmiser-monitor-control) # # Functions to support heatmiser setup, these functions will be used by the XAP handler # hm_lock(on/off,nodes=StatList) # hm_setTemp(temp,nodes=StatList) # hm_setTemp(temp,nodeName<string>)) # hm...
Python
# # Ian Shaw # # Debug script to set temperature on all array t-stats # import serial from struct import pack import time import sys import os from stats_defn import * from hm_constants import * from hm_utils import * from hm_controlfuncs import * problem = 0 #sys.stderr = open('errorlog.txt', ...
Python
# # Neil Trimboy 2011 # # Protocol for each controller HMV2_ID = 2 HMV3_ID = 3 BYTEMASK = 0xff # Constants for Methods # Passed to hmVerifyMsgCRCOK when message is of type FUNC_WRITE DONT_CARE_LENGTH = 1 # # HM Version 3 Magic Numbers # # Master must be in range [0x81,0xa0] = [129,160] MASTER_...
Python
from time import sleep import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) GPIO.setup(5, GPIO.OUT) GPIO.setup(16, GPIO.OUT) GPIO.setup(18, GPIO.OUT) GPIO.output(5, GPIO.LOW) GPIO.output(16, GPIO.LOW) GPIO.output(18, GPIO.HIGH) sleep(3) GPIO.cleanup()
Python
# # Original: Neil Trimboy 2011 # Updated for Shawpad configuration: Ian Shaw # from hm_constants import * import serial # Master Address MY_MASTER_ADDR = 0x81 # Port S_PORT_NAME = '/dev/ttyUSB0' COM_PORT = S_PORT_NAME COM_BAUD = 4800 COM_SIZE = serial.EIGHTBITS COM_PARITY = serial.PARITY_NONE COM_S...
Python
#!/usr/bin/env python # Heating System handler # loop manages polling of Heatmiser Thermostats and handle xAP events # listens for xAP events and event slices in xAP / Thermostat updates # code located on http://code.google.com/p/flubber-hah # reference code for heatmiser from http://code.google.com/p/heatmiser-contro...
Python
# # Neil Trimboy 2011 # # Sets current time/date to all controllers # # Despite Heatmiser V3 protocol document stating that current day/h/m/s is on 4 separate addresses [43,46] # Tests showed that it was not possible to write to individual value anf that all 4 values must be written in a single command import se...
Python
#!/usr/bin/env python # Heatmiser Thermostats Polling # Polls the list of TStats and sends out current temperatures for every stat # Polling by default once per minute # code located on http://code.google.com/p/flubber-hah # reference code for vbusdecode from http://code.google.com/p/heatmiser-control # reference code...
Python
# # Neil Trimboy 2011 # Assume Pyhton 2.7.x # import serial from struct import pack import time import sys import os import shutil from datetime import datetime # Import our own stuff from stats_defn import * from hm_constants import * # Believe this is known as CCITT (0xFFFF) # This is the CRC fun...
Python
#!/usr/bin/env python # trigger on heating info or cmd messages # # for each heating event capture event / info message states # need to cater for all elements in the stat_defn # read the t-stats list # setup triggers for info,event and cmd bsc messages # info request messages can simply return the current temp status...
Python
#!/usr/bin/env python # # XAP support library # # brett@dbzoo.com # # Updated for flubber # ian@shawpad.com import socket, traceback, time class Xap: def __init__(self, uid, source): self.heartbeat_tick = 0; self.uid = uid self.source = source self.sourceInstance = "" self....
Python
#!/usr/bin/python2.4 # # Copyright 2007 The Python-Twitter Developers # # 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...
Python
#!/usr/bin/python2.4 # -*- coding: utf-8 -*-# # # Copyright 2007 The Python-Twitter Developers # # 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...
Python
#!/usr/bin/python2.4 '''Load the latest update for a Twitter user and leave it in an XHTML fragment''' __author__ = 'dewitt@google.com' import codecs import getopt import sys import twitter TEMPLATE = """ <div class="twitter"> <span class="twitter-user"><a href="http://twitter.com/%s">Twitter</a>: </span> <span...
Python
#!/usr/bin/python2.4 '''Post a message to twitter''' __author__ = 'dewitt@google.com' import ConfigParser import getopt import os import sys import twitter USAGE = '''Usage: tweet [options] message This script posts a message to Twitter. Options: -h --help : print this help --consumer-key : the twit...
Python
#!/usr/bin/python2.4 # # Copyright 2007 The Python-Twitter Developers # # 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...
Python
#!/usr/bin/python2.4 # # Copyright 2007 The Python-Twitter Developers # # 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...
Python
"""Implementation of JSONDecoder """ import re import sys import struct from simplejson.scanner import make_scanner try: from simplejson._speedups import scanstring as c_scanstring except ImportError: c_scanstring = None __all__ = ['JSONDecoder'] FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL def _floatconst...
Python
"""JSON token scanner """ import re try: from simplejson._speedups import make_scanner as c_make_scanner except ImportError: c_make_scanner = None __all__ = ['make_scanner'] NUMBER_RE = re.compile( r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?', (re.VERBOSE | re.MULTILINE | re.DOTALL)) def py_make_scan...
Python
"""Implementation of JSONEncoder """ import re try: from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii except ImportError: c_encode_basestring_ascii = None try: from simplejson._speedups import make_encoder as c_make_encoder except ImportError: c_make_encoder = None ...
Python
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`simplejson` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is the externally maintained version of ...
Python
r"""Using simplejson from the shell to validate and pretty-print:: $ echo '{"json":"obj"}' | python -msimplejson.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -msimplejson.tool Expecting property name: line 1 column 2 (char 2) """ import simplejson def main(): import sys if l...
Python
#!/usr/bin/python2.4 # # Copyright 2007 The Python-Twitter Developers # # 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...
Python
#!/usr/bin/env python """html2text: Turn HTML into equivalent Markdown-structured text.""" __version__ = "2.38" __author__ = "Aaron Swartz (me@aaronsw.com)" __copyright__ = "(C) 2004-2008 Aaron Swartz. GNU GPL 3." __contributors__ = ["Martin 'Joey' Schulze", "Ricardo Reyes", "Kevin Jay North"] # TODO: # Support deco...
Python
# coding: utf8 { '"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 r...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Uaktualnij" jest dodatkowym wyrażeniem postaci "pole1=\'nowawartość\'". Nie możesz uaktualnić lub usunąć wyników z JOIN:', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"actualice" es una expresión opcional como "campo1=\'nuevo_valor\'". No se puede actualizar o eliminar resultados de un JOIN', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%...
Python
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" è un\'espressione opzionale come "campo1=\'nuovo valore\'". Non si può fare "update" o "delete" dei risultati di un JOIN ', '%Y-%m-%d': '%d/%m/%Y', '%Y-%m-%d %H:%M:%S': '%d/%m/%...
Python