code
stringlengths
1
1.72M
language
stringclasses
1 value
import maya.cmds as cmds if (not cmds.objExists("screwMountShader")): screwMountShader = cmds.shadingNode('lambert', asShader=True,name="screwMountShader"); cmds.setAttr("screwMountShader.color",0.960784,0.0753556,0.0753556,type="double3"); wallThickness = 0.7; baseThickness = 1.4; boardBuffer = 1.0;#dist...
Python
import maya.cmds as cmds; # cmds.SelectAll(); # cmds.Delete(); wallthickness_mount = 2.0; #taken from strykercode as a starting point def createScrewMount(x,y): motorHoleRadius1 = 3.2/2.0; #actual = 3 adding fudge motorHoleRadius2 = 6.2/2.0;#actual = 6 adding fudge curve2 = cmds.curve(d=1,ep=...
Python
# # Copyright 2012 Autodesk, Inc. All rights reserved. # # Use of this software is subject to the terms of the Autodesk license # agreement provided at the time of installation or download, or which # otherwise accompanies this software in either electronic or hard copy form. # __copyright__ = "Copyr...
Python
import maya.cmds as cmds cmds.SelectAll(); cmds.Delete(); baseCylinderRadius = 13; wallthickness_mount = 2.0; #taken from strykercode as a starting point motorHolesRadius = 7.7/2; xSeparation = 19.0; zSeparation = 16.0; def createScrewMount( x, z): motorHoleRadius1 = 3.2/2;#actual = 3 adding fudge ...
Python
import maya.cmds as cmds; import maya.mel; cmds.SelectAll(); cmds.Delete(); wallThickness = 4.0; horizontalBoomFudge = 0.1; boomWidth = 12.7 + horizontalBoomFudge;# 0 .5 in to mm height = wallThickness + boomWidth/2.0;# just making it 3 mm to be an even metric number, fudge = 0.6; zipWidth = 5.0; zip...
Python
import maya.cmds as cmds if (not cmds.objExists("screwMountShader")): screwMountShader = cmds.shadingNode('lambert', asShader=True,name="screwMountShader"); cmds.setAttr("screwMountShader.color",0.960784,0.0753556,0.0753556,type="double3"); wallThickness = 0.7; baseThickness = 1.4; boardBuffer = 1.0;#dist...
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.4 or later Recommended: CJKCodecs and iconv_codec <http://cjkpytho...
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.4 or later Recommended: CJKCodecs and iconv_codec <http://cjkpytho...
Python
# Copyright 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 writing, ...
Python
# # Copyright 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 writing...
Python
#!/usr/bin/env python # # Copyright 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 o...
Python
#!/usr/bin/env python # # Copyright 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 o...
Python
#!/usr/bin/env python # # Copyright 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 o...
Python
#!/usr/bin/env python # # Copyright 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 o...
Python
#!/usr/bin/env python # # Copyright 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 o...
Python
#!/usr/bin/env python # # Copyright 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 o...
Python
# # Copyright 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 writing...
Python
import re, getopt,sys BASE2 = "01" BASE10 = "0123456789" def baseconv(number,fromdigits,todigits): if str(number)[0]=='-': number = str(number)[1:] neg=1 else: neg=0 # make an integer out of the number x=long(0) for digit in str(number): x = x*len(fromdigits) + fromd...
Python
################################################################################ # # # Trees # # ...
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
#==================================================================== # 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
import os,time numFrames=100 waitTime=.1 fifoFileName = 'myFifo.tmp' os.system('rm shot*.png') os.system('mkfifo ' + fifoFileName) os.system('mplayer -slave -input file=myFifo.tmp -vf screenshot tv:// -tv driver=v4l2 &') time.sleep(2) for x in range(1,numFrames): fileName = 'shot%04d.png'%(x) os.system('echo "sc...
Python
''' Name: Frame Difference Analyzer Date: 20.04.2009 Author: alex arsenovic Summary: General frame difference analyzer. This is not a functional tool, it is made for visuallizing and understanding motion detection/scene detection/ anything related to frame differencing. This code is not optimized for speed in an...
Python
from googlevoice import Voice, util from os import path, remove from unittest import TestCase, main class VoiceTest(TestCase): voice = Voice() voice.login() outgoing = util.input('Outgoing number (blank to ignore call tests): ') forwarding = None if outgoing: forwarding = util.input('Forwar...
Python
DEFAULT_CONFIG = """ [auth] # Google Account email address (one associated w/ your Voice account) email= # Raw password used or login password= # Optional 2-step authentication key (as provided by Google) smsKey= [gvoice] # Number to place calls from (eg, your google voice number) forwardingNumber= # Default phoneT...
Python
import re from sys import stdout from xml.parsers.expat import ParserCreate from time import gmtime from datetime import datetime from pprint import pprint try: from urllib2 import build_opener,install_opener, \ HTTPCookieProcessor,Request,urlopen from urllib import urlencode,quote except ImportError: ...
Python
from ConfigParser import ConfigParser, NoOptionError import os import settings class Config(ConfigParser): """ ``ConfigParser`` subclass that looks into your home folder for a file named ``.gvoice`` and parses configuration data from it. """ def __init__(self): self.fname = os.path.expandu...
Python
from conf import config from util import * import settings import base64 import os import re qpat = re.compile(r'\?') if settings.DEBUG: import logging logging.basicConfig() log = logging.getLogger('PyGoogleVoice') log.setLevel(logging.DEBUG) else: log = None class Voice(object): """ Main...
Python
""" This project aims to bring the power of the Google Voice API to the Python language in a simple, easy-to-use manner. Currently it allows you to place calls, send sms, download voicemails/recorded messages, and search the various folders of your Google Voice Accounts. You can use the Python API or command line s...
Python
from distutils.core import setup README = """Python Google Voice ==================== Joe McCall & Justin Quick Exposing the Google Voice "API" to the Python language ------------------------------------------------------- Google Voice for Python Allows you to place calls, send sms, download voicemail, and check t...
Python
from googlevoice import Voice from googlevoice.util import input voice = Voice() voice.login() outgoingNumber = input('Number to call: ') forwardingNumber = input('Number to call from [optional]: ') or None voice.call(outgoingNumber, forwardingNumber) if input('Calling now... cancel?[y/N] ').lower() == 'y': voi...
Python
#!/usr/bin/env python from googlevoice import Voice import re import sys voice = Voice() voice.login() conversations = [] page = 0 while True: page += 1 voice.sms(terms={ 'page':('p%d' % page) }) jsonData = voice.sms.data if 'messages' not in jsonData or len(jsonData['messages']) < 1: ...
Python
#!/usr/bin/env python # Based on an example for retrieving SMS data as posted in: # # http://code.google.com/p/pygooglevoice/issues/detail?id=22#c13 from googlevoice import Voice import re import sys import json import time import os import os.path base = "./mirror/" vxmFeeds = ['voicemail'] smsFeeds = ['sms'] mp...
Python
from googlevoice import Voice,util,settings voice = Voice() voice.login() for feed in settings.FEEDS: util.print_(feed.title()) for message in getattr(voice, feed)().messages: util.print_('\t', message)
Python
from googlevoice import Voice,util voice = Voice() voice.login() for message in voice.voicemail().messages: util.print_(message)
Python
from googlevoice import Voice from googlevoice.util import input voice = Voice() voice.login() phoneNumber = input('Number to send message to: ') text = input('Message text: ') voice.send_sms(phoneNumber, text)
Python
#!/usr/bin/env python from googlevoice import Voice import sys import json import getopt try: opts, args = getopt.getopt(sys.argv[1:], "m:", ["messageID="]) except getopt.GetoptError, err: print str(err) usage() sys.exit(2) messageID = "" for o, a in opts: if o in ("-m", "--messageID"): m...
Python
#!/usr/bin/env python from googlevoice import Voice import re import sys voice = Voice() voice.login() conversations = [] page = 0 while True: page += 1 voice.voicemail(terms={ 'page':('p%d' % page) }) jsonData = voice.voicemail.data if 'messages' not in jsonData or len(jsonData['messages']...
Python
from googlevoice import Voice,util voice = Voice() voice.login() util.pprint(voice.settings)
Python
from googlevoice import Voice download_dir = '.' voice = Voice() voice.login() for message in voice.voicemail().messages: message.download(download_dir)
Python
from googlevoice import Voice voice = Voice() voice.login() for message in voice.sms().messages: if message.isRead: message.delete()
Python
from googlevoice import Voice import getopt import sys import json try: opts, args = getopt.getopt(sys.argv[1:], "m:", ["messageID="]) except getopt.GetoptError, err: print str(err) usage() sys.exit(2) messageID = "" for o, a in opts: if o in ("-m", "--messageID"): messageID = a ...
Python
from googlevoice import Voice,util voice = Voice() voice.login() folder = voice.search(util.input('Search query: ')) util.print_('Found %s messages: ', len(folder)) util.pprint(folder.messages)
Python
#!/usr/bin/env python # Download sms messages and archive them if present in inbox # # NOTE: Set download_type below: # 'inbox': Download SMS messages in inbox only and archive them # 'sms': Download all SMS messages and archive them. Set this for initial run download_type = 'inbox' #download_type = 'sms' # Download d...
Python
#!/usr/bin/env python import re import base64 import sys import commands key = raw_input("Enter your 2-step authentication key as provided by Google: ") if re.match(r'[^a-zA-Z2-9]', key): print "ERROR: 2-step key contains invalid characters, expecting only (A-Z,2-9)" sys.exit(1) key = re.sub(r'[^a-zA-Z2-9]'...
Python
# #SMS test via Google Voice # #John Nagle # nagle@animats.com # from googlevoice import Voice import sys import BeautifulSoup def extractsms(htmlsms) : """ extractsms -- extract SMS messages from BeautifulSoup tree of Google Voice SMS HTML. Output is a list of dictionaries, one per message. """ ...
Python
from googlevoice import Voice,util voice = Voice() voice.login() util.pprint(voice.phones)
Python
maxVf = 200 # Generating the header head = """// Copyright qiuc12@gmail.com // This file is generated autmatically by python. DONT MODIFY IT! #pragma once #include <OleAuto.h> class FakeDispatcher; HRESULT DualProcessCommand(int commandId, FakeDispatcher *disp, ...); extern "C" void DualProcessCommandWrap()...
Python
#!/usr/bin/env python from django.core.management import execute_manager import imp try: imp.find_module('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 t...
Python
import os import sys sys.stdout = sys.stderr sys.path.append('/opt/fractal-narratives') os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()
Python
from django.db import models from django.contrib.auth.models import User from django.conf import settings import os class Story(models.Model): owner = models.ForeignKey(User, blank=True, null=True, on_delete=models.SET_NULL) # versions = models.ManyToManyField('application.Version') def __unicode__(self): return ...
Python
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ from django.test import TestCase class SimpleTest(TestCase): def test_basic_addition(self): """ Tests that 1 + 1 a...
Python
from django import template from django.utils.html import conditional_escape from django.utils.safestring import mark_safe from application.models import Story from xml.dom.minidom import parse, parseString register = template.Library() def fractal(value, autoescape=True): if autoescape: esc = conditional_escape ...
Python
from application.models import Story, Version from django.contrib import admin admin.site.register(Story) admin.site.register(Version)
Python
from django.shortcuts import render_to_response, get_object_or_404, redirect from django.views.decorators.http import require_http_methods from django.contrib.auth.decorators import login_required from django.template import RequestContext from django.http import HttpResponse, HttpResponseForbidden, HttpResponseServerE...
Python
#!/usr/bin/env python from django.core.management import execute_manager import imp try: imp.find_module('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 t...
Python
from django.conf.urls.defaults import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^$', 'application.views.index'), url(r'^account/', include('registration.backends.default.urls')), url(r'^account/login_redirect', 'application.views.login_re...
Python
# Django settings for fractalnarratives project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Matt R Taylor', 'mrt@ecs.soton.ac.uk'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. ...
Python
#!/usr/bin/env python import os import optparse import subprocess import sys here = os.path.dirname(__file__) def main(): usage = "usage: %prog [file1..fileN]" description = """With no file paths given this script will automatically compress all jQuery-based files of the admin app. Requires the Google Closure...
Python
#!/usr/bin/env python import os import optparse import subprocess import sys here = os.path.dirname(__file__) def main(): usage = "usage: %prog [file1..fileN]" description = """With no file paths given this script will automatically compress all jQuery-based files of the admin app. Requires the Google Closure...
Python
from flask_wtf import DataRequired from flask_wtf import Length from flask_wtf import ValidationError from flask_wtf import Regexp from flask import flash import re class Required(DataRequired): """ Clase que redefine la clase required a fin de poder modificar sus atributos por defecto """ def __...
Python
''' Created on 18/06/2013 @author: mirta ''' #!/usr/local/bin/python2.7 #import json #import simplejson as json #ESTA SERIA LA CLASE QUE YA TENES #ESTA SERIA LA CLASE QUE YA TENES class Nodo: def __init__(self, ID, nombre, costo): self._id = ID self._nombre = nombre self._costo = costo #Convertimos...
Python
''' Created on 21/06/2013 @author: belentwi ''' import os # cur_dir = os.path.dirname(os.path.abspath(__file__)) from reportlab.lib.pagesizes import A4 from reportlab.lib.units import cm from reportlab.lib.enums import TA_CENTER, TA_RIGHT from geraldo import Report, ReportBand, Label, ObjectValue, SystemField, FIE...
Python
''' Created on 20/06/2013 @author: belentwi ''' import os # cur_dir = os.path.dirname(os.path.abspath(__file__)) from reportlab.lib.pagesizes import A4 from reportlab.lib.units import cm from reportlab.lib.enums import TA_CENTER, TA_RIGHT from geraldo import Report, ReportBand, Label, ObjectValue, SystemField, FI...
Python