code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
#
# Comment tests
#
import unittest
import PloneboardTestCase
from Products.Ploneboard.transforms.url_to_hyperlink import URLToHyperlink
class MockTransformData:
def setData(self, value):
self.data=value
class TestUrlTransform(PloneboardTestCase.PloneboardTestCase):
def runTest(self, testdata):
... | [
[
1,
0,
0.0806,
0.0161,
0,
0.66,
0,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0968,
0.0161,
0,
0.66,
0.2,
964,
0,
1,
0,
0,
964,
0,
0
],
[
1,
0,
0.1129,
0.0161,
0,
0.66,... | [
"import unittest",
"import PloneboardTestCase",
"from Products.Ploneboard.transforms.url_to_hyperlink import URLToHyperlink",
"class MockTransformData:\n def setData(self, value):\n self.data=value",
" def setData(self, value):\n self.data=value",
" self.data=value",
"class Te... |
#
# Ploneboard tests
#
import unittest
from zExceptions import Unauthorized
from zope.interface.verify import verifyClass, verifyObject
from Products.Ploneboard.tests import PloneboardTestCase
from Products.Ploneboard.interfaces import IPloneboard, IForum
from Products.Ploneboard.content.Ploneboard import Ploneboard
f... | [
[
1,
0,
0.0316,
0.0063,
0,
0.66,
0,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.038,
0.0063,
0,
0.66,
0.0769,
550,
0,
1,
0,
0,
550,
0,
0
],
[
1,
0,
0.0443,
0.0063,
0,
0.6... | [
"import unittest",
"from zExceptions import Unauthorized",
"from zope.interface.verify import verifyClass, verifyObject",
"from Products.Ploneboard.tests import PloneboardTestCase",
"from Products.Ploneboard.interfaces import IPloneboard, IForum",
"from Products.Ploneboard.content.Ploneboard import Ploneb... |
from Products.CMFCore import permissions
from Products.CMFCore.permissions import setDefaultRoles
# Add permissions differ for each type, and are imported by __init__.initialize
# so don't change their names!
ViewBoard = permissions.View
SearchBoard = 'Ploneboard: Search'
AddBoard = AddPloneboard = 'Ploneboard: Add P... | [
[
1,
0,
0.0132,
0.0132,
0,
0.66,
0,
396,
0,
1,
0,
0,
396,
0,
0
],
[
1,
0,
0.0263,
0.0132,
0,
0.66,
0.0294,
892,
0,
1,
0,
0,
892,
0,
0
],
[
14,
0,
0.0921,
0.0132,
0,
... | [
"from Products.CMFCore import permissions",
"from Products.CMFCore.permissions import setDefaultRoles",
"ViewBoard = permissions.View",
"SearchBoard = 'Ploneboard: Search'",
"AddBoard = AddPloneboard = 'Ploneboard: Add Ploneboard'",
"ManageBoard = 'Ploneboard: Add Ploneboard'",
"RequestReview = permissi... |
from zope.interface import implements
from Products.ATContentTypes.interface import ITextContent
class CommentTextContent(object):
implements(ITextContent)
def __init__(self, context):
self.context = context
def getText(self, **kwargs):
return self.context.getText()
def setText(self... | [
[
1,
0,
0.0476,
0.0476,
0,
0.66,
0,
443,
0,
1,
0,
0,
443,
0,
0
],
[
1,
0,
0.1429,
0.0476,
0,
0.66,
0.5,
11,
0,
1,
0,
0,
11,
0,
0
],
[
3,
0,
0.619,
0.8095,
0,
0.66,
... | [
"from zope.interface import implements",
"from Products.ATContentTypes.interface import ITextContent",
"class CommentTextContent(object):\n implements(ITextContent)\n\n def __init__(self, context):\n self.context = context\n\n def getText(self, **kwargs):\n return self.context.getText()",... |
"""Migrate from 0.1b1 to 1.0b.
"""
# Zope imports
from ZODB.PersistentMapping import PersistentMapping
from Acquisition import aq_base
# CMF imports
from Products.CMFCore.utils import getToolByName
# Product imports
class Migration(object):
"""Migrate from 0.1b1 to 1.0b.
"""
def __init__(self, site, ou... | [
[
8,
0,
0.0221,
0.0294,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0588,
0.0147,
0,
0.66,
0.25,
375,
0,
1,
0,
0,
375,
0,
0
],
[
1,
0,
0.0735,
0.0147,
0,
0.66,
... | [
"\"\"\"Migrate from 0.1b1 to 1.0b.\n\"\"\"",
"from ZODB.PersistentMapping import PersistentMapping",
"from Acquisition import aq_base",
"from Products.CMFCore.utils import getToolByName",
"class Migration(object):\n \"\"\"Migrate from 0.1b1 to 1.0b.\n \"\"\"\n\n def __init__(self, site, out):\n ... |
"""
$Id: __init__.py 53403 2007-11-08 09:54:35Z wichert $
"""
from Products.Archetypes.public import process_types, listTypes
from Products.CMFCore.DirectoryView import registerDirectory
from Products.Ploneboard.PloneboardTool import PloneboardTool
import sys
from Products.Ploneboard.config import SKINS_DIR, GLOBALS... | [
[
8,
0,
0.0339,
0.0508,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0847,
0.0169,
0,
0.66,
0.0909,
257,
0,
2,
0,
0,
257,
0,
0
],
[
1,
0,
0.1017,
0.0169,
0,
0.66... | [
"\"\"\"\n$Id: __init__.py 53403 2007-11-08 09:54:35Z wichert $\n\"\"\"",
"from Products.Archetypes.public import process_types, listTypes",
"from Products.CMFCore.DirectoryView import registerDirectory",
"from Products.Ploneboard.PloneboardTool import PloneboardTool",
"import sys",
"from Products.Ploneboa... |
from zope.interface import implements
from zope.app.schema.vocabulary import IVocabularyFactory
from Products.CMFCore.utils import getToolByName
from zope.schema.vocabulary import SimpleVocabulary
class AvailableTransformsVocabulary(object):
"""Vocabulary for available Ploneboard transforms.
"""
implements... | [
[
1,
0,
0.0526,
0.0526,
0,
0.66,
0,
443,
0,
1,
0,
0,
443,
0,
0
],
[
1,
0,
0.1053,
0.0526,
0,
0.66,
0.2,
93,
0,
1,
0,
0,
93,
0,
0
],
[
1,
0,
0.1579,
0.0526,
0,
0.66,... | [
"from zope.interface import implements",
"from zope.app.schema.vocabulary import IVocabularyFactory",
"from Products.CMFCore.utils import getToolByName",
"from zope.schema.vocabulary import SimpleVocabulary",
"class AvailableTransformsVocabulary(object):\n \"\"\"Vocabulary for available Ploneboard transf... |
"""
$Id: config.py 55779 2007-12-18 14:26:49Z fschulze $
"""
PROJECTNAME = "Ploneboard"
SKINS_DIR = 'skins'
I18N_DOMAIN = PROJECTNAME.lower()
# Transform config
EMOTICON_TRANSFORM_ID = 'text_to_emoticons'
EMOTICON_TRANSFORM_MODULE = 'Products.Ploneboard.transforms.text_to_emoticons'
URL_TRANSFORM_MODULE = 'Products.Pl... | [
[
8,
0,
0.069,
0.1034,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
14,
0,
0.1379,
0.0345,
0,
0.66,
0.0769,
239,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.1724,
0.0345,
0,
0.66,... | [
"\"\"\"\n$Id: config.py 55779 2007-12-18 14:26:49Z fschulze $\n\"\"\"",
"PROJECTNAME = \"Ploneboard\"",
"SKINS_DIR = 'skins'",
"I18N_DOMAIN = PROJECTNAME.lower()",
"EMOTICON_TRANSFORM_ID = 'text_to_emoticons'",
"EMOTICON_TRANSFORM_MODULE = 'Products.Ploneboard.transforms.text_to_emoticons'",
"URL_TRANSF... |
from setuptools import setup, find_packages
version = '2.1b2'
setup(name='Products.Ploneboard',
version=version,
description="A discussion board for Plone.",
long_description=open("README.txt").read() + \
open("docs/INSTALL.txt").read() + \
open("docs/... | [
[
1,
0,
0.027,
0.027,
0,
0.66,
0,
182,
0,
2,
0,
0,
182,
0,
0
],
[
14,
0,
0.0811,
0.027,
0,
0.66,
0.5,
623,
1,
0,
0,
0,
0,
3,
0
],
[
8,
0,
0.5676,
0.8919,
0,
0.66,
... | [
"from setuptools import setup, find_packages",
"version = '2.1b2'",
"setup(name='Products.Ploneboard',\n version=version,\n description=\"A discussion board for Plone.\",\n long_description=open(\"README.txt\").read() + \\\n open(\"docs/INSTALL.txt\").read() + \\\n ... |
##############################################################################
#
# Copyright (c) 2006 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SO... | [
[
8,
0,
0.3182,
0.1455,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.4182,
0.0182,
0,
0.66,
0.0909,
688,
0,
5,
0,
0,
688,
0,
0
],
[
14,
0,
0.4545,
0.0182,
0,
0.6... | [
"\"\"\"Bootstrap a buildout-based project\n\nSimply run this script in a directory containing a buildout.cfg.\nThe script accepts buildout command-line options, so you can\nuse the -c option to specify an alternate configuration file.\n\n$Id: bootstrap.py 75593 2007-05-06 21:11:27Z jim $\n\"\"\"",
"import os, shu... |
#coding=utf8
__author__ = 'alex'
import datetime
import uuid
from sqlalchemy import Column,Integer,String,DateTime,Boolean,Text,UniqueConstraint,Table, MetaData,ForeignKey, Numeric
from sqlalchemy.ext.declarative import declarative_base, declared_attr
from sqlalchemy.orm import relationship,backref
from decimal import ... | [
[
14,
0,
0.0112,
0.0056,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0169,
0.0056,
0,
0.66,
0.0667,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0225,
0.0056,
0,
0... | [
"__author__ = 'alex'",
"import datetime",
"import uuid",
"from sqlalchemy import Column,Integer,String,DateTime,Boolean,Text,UniqueConstraint,Table, MetaData,ForeignKey, Numeric",
"from sqlalchemy.ext.declarative import declarative_base, declared_attr",
"from sqlalchemy.orm import relationship,backref",
... |
#coding=utf8
__author__ = 'alex'
DEBUG = True
LOCAL = True
MEDIA_ROOT = "/static/"
if LOCAL:
DB_URI = "mysql://root:123456@127.0.0.1:3306/315db?charset=utf8"
else:
DB_URI = "mysql://root:123456@127.0.0.1:3306/315db?charset=utf8"
TIMEOUT = 3600
SECRET_KEY = "11556666433221changge!" | [
[
14,
0,
0.1667,
0.0833,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
14,
0,
0.3333,
0.0833,
0,
0.66,
0.1667,
309,
1,
0,
0,
0,
0,
4,
0
],
[
14,
0,
0.4167,
0.0833,
0,
0... | [
"__author__ = 'alex'",
"DEBUG = True",
"LOCAL = True",
"MEDIA_ROOT = \"/static/\"",
"if LOCAL:\n DB_URI = \"mysql://root:123456@127.0.0.1:3306/315db?charset=utf8\"\nelse:\n DB_URI = \"mysql://root:123456@127.0.0.1:3306/315db?charset=utf8\"",
" DB_URI = \"mysql://root:123456@127.0.0.1:3306/315db?c... |
#coding=utf8
__author__ = 'alex'
from flask import Blueprint, render_template, abort, g, request, redirect, url_for, session, flash, send_file
from utils import *
from biz import *
from models import *
index = Blueprint('index', __name__,template_folder='templates',url_prefix='/')
@index.app_template_filter(name="con... | [
[
14,
0,
0.0435,
0.0217,
0,
0.66,
0,
777,
1,
0,
0,
0,
0,
3,
0
],
[
1,
0,
0.0652,
0.0217,
0,
0.66,
0.0909,
782,
0,
10,
0,
0,
782,
0,
0
],
[
1,
0,
0.087,
0.0217,
0,
0... | [
"__author__ = 'alex'",
"from flask import Blueprint, render_template, abort, g, request, redirect, url_for, session, flash, send_file",
"from utils import *",
"from biz import *",
"from models import *",
"index = Blueprint('index', __name__,template_folder='templates',url_prefix='/')",
"def show_content... |
#!/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... | [
[
1,
0,
0.0588,
0.0118,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0706,
0.0118,
0,
0.66,
0.125,
614,
0,
1,
0,
0,
614,
0,
0
],
[
1,
0,
0.0824,
0.0118,
0,
0... | [
"import logging",
"import shutil",
"import sys",
"import urlparse",
"import SimpleHTTPServer",
"import BaseHTTPServer",
"class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):\n \"\"\"Handle playfoursquare.com requests, for testing.\"\"\"\n\n def do_GET(self):\n logging.warn('do_GET: %s, %s',... |
#!/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... | [
[
1,
0,
0.1111,
0.037,
0,
0.66,
0,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.1481,
0.037,
0,
0.66,
0.1429,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.1852,
0.037,
0,
0.6... | [
"import os",
"import subprocess",
"import sys",
"BASEDIR = '../main/src/com/joelapenna/foursquare'",
"TYPESDIR = '../captures/types/v1'",
"captures = sys.argv[1:]",
"if not captures:\n captures = os.listdir(TYPESDIR)",
" captures = os.listdir(TYPESDIR)",
"for f in captures:\n basename = f.split('... |
#!/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.... | [
[
8,
0,
0.0631,
0.0991,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1261,
0.009,
0,
0.66,
0.05,
2,
0,
1,
0,
0,
2,
0,
0
],
[
1,
0,
0.1351,
0.009,
0,
0.66,
0.... | [
"\"\"\"\nPull a oAuth protected page from foursquare.\n\nExpects ~/.oget to contain (one on each line):\nCONSUMER_KEY\nCONSUMER_KEY_SECRET\nUSERNAME\nPASSWORD",
"import httplib",
"import os",
"import re",
"import sys",
"import urllib",
"import urllib2",
"import urlparse",
"import user",
"from xml.... |
#!/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... | [
[
1,
0,
0.0201,
0.0067,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0268,
0.0067,
0,
0.66,
0.0769,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0336,
0.0067,
0,
... | [
"import datetime",
"import sys",
"import textwrap",
"import common",
"from xml.dom import pulldom",
"PARSER = \"\"\"\\\n/**\n * Copyright 2009 Joe LaPenna\n */\n\npackage com.joelapenna.foursquare.parsers;\n\nimport com.joelapenna.foursquare.Foursquare;",
"BOOLEAN_STANZA = \"\"\"\\\n } else i... |
#!/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... | [
[
1,
0,
0.0263,
0.0088,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0439,
0.0088,
0,
0.66,
0.0833,
290,
0,
1,
0,
0,
290,
0,
0
],
[
1,
0,
0.0526,
0.0088,
0,
... | [
"import logging",
"from xml.dom import minidom",
"from xml.dom import pulldom",
"BOOLEAN = \"boolean\"",
"STRING = \"String\"",
"GROUP = \"Group\"",
"DEFAULT_INTERFACES = ['FoursquareType']",
"INTERFACES = {\n}",
"DEFAULT_CLASS_IMPORTS = [\n]",
"CLASS_IMPORTS = {\n# 'Checkin': DEFAULT_CLASS_IMP... |
# Copyright 2008 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, ... | [
[
8,
0,
0.1667,
0.0789,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2281,
0.0088,
0,
0.66,
0.0476,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.2368,
0.0088,
0,
0.66... | [
"\"\"\"Main program for Rietveld.\n\nThis is also a template for running a Django app under Google App\nEngine, especially when using a newer version of Django than provided\nin the App Engine standard library.\n\nThe site-specific code is all in other files: urls.py, models.py,\nviews.py, settings.py.",
"import ... |
# Removes duplicate nicknames (issue99).
#
# To run this script:
# - Make sure App Engine library (incl. yaml) is in PYTHONPATH.
# - Make sure that the remote API is included in app.yaml.
# - Run "tools/appengine_console.py APP_ID".
# - Import this module.
# - update_accounts.run() updates accounts.
# - Use the o... | [
[
1,
0,
0.2097,
0.0161,
0,
0.66,
0,
167,
0,
1,
0,
0,
167,
0,
0
],
[
1,
0,
0.2419,
0.0161,
0,
0.66,
0.25,
844,
0,
1,
0,
0,
844,
0,
0
],
[
2,
0,
0.4194,
0.2742,
0,
0.... | [
"from google.appengine.ext import db",
"from codereview import models",
"def fetch_accounts():\n query = models.Account.all()\n accounts = {}\n results = query.fetch(100)\n while results:\n last = None\n for account in results:\n if account.lower_nickname in accounts:",
" ... |
"""Configuration."""
import logging
import os
import re
from google.appengine.ext.appstats import recording
logging.info('Loading %s from %s', __name__, __file__)
# Custom webapp middleware to add Appstats.
def webapp_add_wsgi_middleware(app):
app = recording.appstats_wsgi_middleware(app)
return app
# Custom A... | [
[
8,
0,
0.0238,
0.0238,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0714,
0.0238,
0,
0.66,
0.0714,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0952,
0.0238,
0,
0.66... | [
"\"\"\"Configuration.\"\"\"",
"import logging",
"import os",
"import re",
"from google.appengine.ext.appstats import recording",
"logging.info('Loading %s from %s', __name__, __file__)",
"def webapp_add_wsgi_middleware(app):\n app = recording.appstats_wsgi_middleware(app)\n return app",
" app = rec... |
# 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, ... | [
[
8,
0,
0.2727,
0.0182,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3091,
0.0182,
0,
0.66,
0.25,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.3455,
0.0182,
0,
0.66,
... | [
"\"\"\"Test utils.\"\"\"",
"import os",
"from google.appengine.ext import testbed",
"from django.test import TestCase as _TestCase",
"class TestCase(_TestCase):\n \"\"\"Customized Django TestCase.\n\n This class disables the setup of Django features that are not\n available on App Engine (e.g. fixture lo... |
#!/usr/bin/env 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 ... | [
[
1,
0,
0.1345,
0.0084,
0,
0.66,
0,
44,
0,
1,
0,
0,
44,
0,
0
],
[
1,
0,
0.1429,
0.0084,
0,
0.66,
0.0435,
784,
0,
1,
0,
0,
784,
0,
0
],
[
1,
0,
0.1513,
0.0084,
0,
0.... | [
"import code",
"import getpass",
"import logging",
"import optparse",
"import os",
"import re",
"import sys",
"ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..')",
"LIB = os.path.join(ROOT, '..', 'google_appengine', 'lib')",
"sys.path.insert(0, os.path.join(ROOT, '..', 'google_a... |
# Copyright 2008-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... | [
[
8,
0,
0.5357,
0.0357,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.6429,
0.0357,
0,
0.66,
0.5,
341,
0,
1,
0,
0,
341,
0,
0
],
[
14,
0,
0.9464,
0.1429,
0,
0.66,
... | [
"\"\"\"Top-level URL mappings for Rietveld.\"\"\"",
"from django.conf.urls.defaults import *",
"urlpatterns = patterns(\n '',\n url(r'', include('codereview.urls')),\n )"
] |
# Copyright 2008 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, ... | [
[
8,
0,
0.25,
0.0167,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2833,
0.0167,
0,
0.66,
0.05,
688,
0,
1,
0,
0,
688,
0,
0
],
[
1,
0,
0.3167,
0.0167,
0,
0.66,
... | [
"\"\"\"Minimal Django settings.\"\"\"",
"import os",
"from google.appengine.api import app_identity",
"APPEND_SLASH = False",
"DEBUG = os.environ['SERVER_SOFTWARE'].startswith('Dev')",
"INSTALLED_APPS = (\n 'codereview',\n)",
"MIDDLEWARE_CLASSES = (\n 'django.middleware.common.CommonMiddleware',\n... |
# Copyright 2008 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, ... | [
[
8,
0,
0.0188,
0.0013,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0225,
0.0013,
0,
0.66,
0.0435,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0238,
0.0013,
0,
0.66... | [
"\"\"\"App Engine data model (schema) definition for Rietveld.\"\"\"",
"import logging",
"import md5",
"import os",
"import re",
"import time",
"from google.appengine.ext import db",
"from google.appengine.api import memcache",
"from google.appengine.api import users",
"import engine",
"import p... |
# Copyright 2008 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, ... | [
[
1,
0,
0.0904,
0.006,
0,
0.66,
0,
426,
0,
1,
0,
0,
426,
0,
0
],
[
1,
0,
0.0964,
0.006,
0,
0.66,
0.0625,
604,
0,
1,
0,
0,
604,
0,
0
],
[
1,
0,
0.1084,
0.006,
0,
0.6... | [
"import datetime",
"import md5",
"from django.contrib.syndication.feeds import Feed",
"from django.core.exceptions import ObjectDoesNotExist",
"from django.core.urlresolvers import reverse",
"from django.utils.feedgenerator import Atom1Feed",
"import library",
"import models",
"class BaseFeed(Feed):... |
# Copyright 2008 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, ... | [
[
8,
0,
0.0417,
0.0417,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0647,
0.0014,
0,
0.66,
0.037,
934,
0,
1,
0,
0,
934,
0,
0
],
[
1,
0,
0.0662,
0.0014,
0,
0.66,... | [
"\"\"\"Intra-region diff utilities.\n\nIntra-region diff highlights the blocks of code which have been changed or\ndeleted within a region. So instead of highlighting the whole region marked as\nchanged, the user can see what exactly was changed within that region.\n\nTerminology:\n 'region' is a list of consecuti... |
# Copyright 2008 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, ... | [
[
8,
0,
0.0656,
0.0193,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0811,
0.0039,
0,
0.66,
0.0909,
866,
0,
1,
0,
0,
866,
0,
0
],
[
1,
0,
0.0849,
0.0039,
0,
0.66... | [
"\"\"\"Utility to read and apply a unified diff without forking patch(1).\n\nFor a discussion of the unified diff format, see my blog on Artima:\nhttp://www.artima.com/weblogs/viewpost.jsp?thread=164293\n\"\"\"",
"import difflib",
"import logging",
"import re",
"import sys",
"_CHUNK_RE = re.compile(r\"\"\... |
# Copyright 2008 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, ... | [
[
8,
0,
0.1546,
0.0103,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1856,
0.0103,
0,
0.66,
0.2,
341,
0,
1,
0,
0,
341,
0,
0
],
[
1,
0,
0.1959,
0.0103,
0,
0.66,
... | [
"\"\"\"URL mappings for the codereview package.\"\"\"",
"from django.conf.urls.defaults import *",
"import django.views.defaults",
"from codereview import feeds",
"urlpatterns = patterns(\n 'codereview.views',\n (r'^$', 'index'),\n (r'^all$', 'all'),\n (r'^mine$', 'mine'),\n (r'^starred$', 's... |
# Copyright 2008 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, ... | [
[
8,
0,
0.4545,
0.0303,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.5152,
0.0303,
0,
0.66,
0.3333,
279,
0,
1,
0,
0,
279,
0,
0
],
[
1,
0,
0.5758,
0.0303,
0,
0.66... | [
"\"\"\"Custom middleware. Some of this may be generally useful.\"\"\"",
"from google.appengine.api import users",
"import models",
"class AddUserToRequestMiddleware(object):\n \"\"\"Add a user object and a user_is_admin flag to each request.\"\"\"\n\n def process_request(self, request):\n request.user =... |
# Copyright 2008 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, ... | [
[
8,
0,
0.0584,
0.0039,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0661,
0.0039,
0,
0.66,
0.05,
934,
0,
1,
0,
0,
934,
0,
0
],
[
1,
0,
0.07,
0.0039,
0,
0.66,
... | [
"\"\"\"Django template library for Rietveld.\"\"\"",
"import cgi",
"import logging",
"from google.appengine.api import memcache",
"from google.appengine.api import users",
"import django.template",
"import django.utils.safestring",
"from django.core.urlresolvers import reverse",
"import models",
"... |
import BasicEditor | [
[
1,
0,
1,
1,
0,
0.66,
0,
685,
0,
1,
0,
0,
685,
0,
0
]
] | [
"import BasicEditor"
] |
'''
Created on 2010-04-19
@author: Philippe Beaudoin
'''
from distutils.core import setup
import py2exe
setup(windows=['BasicEditor.py'],
options={
"py2exe": {
"includes": ["ctypes", "logging"],
"excludes": ["OpenGL"],
}
}
) | [
[
8,
0,
0.1875,
0.3125,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.375,
0.0625,
0,
0.66,
0.3333,
152,
0,
1,
0,
0,
152,
0,
0
],
[
1,
0,
0.4375,
0.0625,
0,
0.66,... | [
"'''\nCreated on 2010-04-19\n\n@author: Philippe Beaudoin\n'''",
"from distutils.core import setup",
"import py2exe",
"setup(windows=['BasicEditor.py'],\n options={\n \"py2exe\": {\n \"includes\": [\"ctypes\", \"logging\"],\n \"excludes\": [\"OpenGL\"],\n }... |
import MathLib
x = MathLib.Vector3d()
x.setValues(10,0.44,-132)
print "x = ",
x._print()
y = MathLib.Vector3d()
y.setValues(3,11,2)
print "y = ",
y._print()
x.addScaledVector(y,0.5)
print "x + 0.5y = ",
x._print()
| [
[
1,
0,
0.0714,
0.0714,
0,
0.66,
0,
209,
0,
1,
0,
0,
209,
0,
0
],
[
14,
0,
0.2143,
0.0714,
0,
0.66,
0.0909,
190,
3,
0,
0,
0,
624,
10,
1
],
[
8,
0,
0.2857,
0.0714,
0,
... | [
"import MathLib",
"x = MathLib.Vector3d()",
"x.setValues(10,0.44,-132)",
"print(\"x = \",)",
"x._print()",
"y = MathLib.Vector3d()",
"y.setValues(3,11,2)",
"print(\"y = \",)",
"y._print()",
"x.addScaledVector(y,0.5)",
"print(\"x + 0.5y = \",)",
"x._print()"
] |
import Utils
Utils.test() | [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
842,
0,
1,
0,
0,
842,
0,
0
],
[
8,
0,
1,
0.3333,
0,
0.66,
1,
224,
3,
0,
0,
0,
0,
0,
1
]
] | [
"import Utils",
"Utils.test()"
] |
'''
Created on 2009-09-29
@author: beaudoin
'''
import PyUtils
class Curve(PyUtils.Observable):
"""This class contains a named curve that can be observed."""
def __init__(self, name, trajectory1d, phiPtr = None):
"""Initializes a curve with the given name and attached to the given tr... | [
[
8,
0,
0.0909,
0.1515,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2121,
0.0303,
0,
0.66,
0.5,
806,
0,
1,
0,
0,
806,
0,
0
],
[
3,
0,
0.6364,
0.7576,
0,
0.66,
... | [
"'''\nCreated on 2009-09-29\n\n@author: beaudoin\n'''",
"import PyUtils",
"class Curve(PyUtils.Observable):\n \"\"\"This class contains a named curve that can be observed.\"\"\"\n \n def __init__(self, name, trajectory1d, phiPtr = None):\n \"\"\"Initializes a curve with the given name and attach... |
'''
Created on 2009-09-28
@author: beaudoin
'''
import PyUtils
class ObservableList(PyUtils.Observable):
"""An object that contains a list of observable objects of the application (i.e. controllers, characters...)"""
def __init__(self):
super(ObservableList,self).__init__()
... | [
[
8,
0,
0.0545,
0.0909,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1091,
0.0182,
0,
0.66,
0.5,
806,
0,
1,
0,
0,
806,
0,
0
],
[
3,
0,
0.5727,
0.8727,
0,
0.66,
... | [
"'''\nCreated on 2009-09-28\n\n@author: beaudoin\n'''",
"import PyUtils",
"class ObservableList(PyUtils.Observable):\n \"\"\"An object that contains a list of observable objects of the application (i.e. controllers, characters...)\"\"\"\n\n def __init__(self):\n super(ObservableList,self).__init__(... |
'''
Created on 2009-10-02
@author: beaudoin
'''
import PyUtils, Core, time, Physics, Utils, wx
class Snapshot(PyUtils.Observable):
"""This class contains a snapshot. That is, the entire state of the world, the controllers and the character."""
def __init__(self, parentBranch):
"""Tak... | [
[
8,
0,
0.0122,
0.0204,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0286,
0.0041,
0,
0.66,
0.3333,
806,
0,
6,
0,
0,
806,
0,
0
],
[
3,
0,
0.298,
0.5265,
0,
0.66,... | [
"'''\nCreated on 2009-10-02\n\n@author: beaudoin\n'''",
"import PyUtils, Core, time, Physics, Utils, wx",
"class Snapshot(PyUtils.Observable):\n \"\"\"This class contains a snapshot. That is, the entire state of the world, the controllers and the character.\"\"\"\n \n def __init__(self, parentBranch):\... |
'''
Created on 2009-11-20
@author: beaudoin
'''
from OpenGL.GL import *
import wx, GLUtils, PyUtils, math, traceback, sys
import UI
class CharacterScaler(UI.GLUITools.WindowWithControlPoints):
"""Base class for a simple GL window that display a character with handles to scale its various elements."""
... | [
[
8,
0,
0.0099,
0.0164,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.023,
0.0033,
0,
0.66,
0.0526,
280,
0,
1,
0,
0,
280,
0,
0
],
[
1,
0,
0.0263,
0.0033,
0,
0.66,... | [
"'''\nCreated on 2009-11-20\n\n@author: beaudoin\n'''",
"from OpenGL.GL import *",
"import wx, GLUtils, PyUtils, math, traceback, sys",
"import UI",
"class CharacterScaler(UI.GLUITools.WindowWithControlPoints):\n \"\"\"Base class for a simple GL window that display a character with handles to scale its v... |
'''
Created on 2009-11-20
@author: beaudoin
'''
import Core, Physics, PyUtils
from MathLib import Vector3d, Point3d
class CharacterDescription(object):
"""A simple description of a character
Be careful:
Left refer to the left-hand-side of the character (which is seen to the right from the... | [
[
8,
0,
0.0045,
0.0075,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0104,
0.0015,
0,
0.66,
0.2,
463,
0,
3,
0,
0,
463,
0,
0
],
[
1,
0,
0.0119,
0.0015,
0,
0.66,
... | [
"'''\nCreated on 2009-11-20\n\n@author: beaudoin\n'''",
"import Core, Physics, PyUtils",
"from MathLib import Vector3d, Point3d",
"class CharacterDescription(object):\n \"\"\"A simple description of a character\n Be careful: \n Left refer to the left-hand-side of the character (which is seen to th... |
'''
Created on 2009-11-23
@author: beaudoin
'''
import wx, GLUtils, PyUtils, Core, Physics, Controllers
from CharacterDescription import CharacterDescription
from CharacterScaler import CharacterScalerFront
from ToolSet import ToolSet
class Model(object):
def __init__(self):
"""Creat... | [
[
8,
0,
0.0182,
0.0303,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0424,
0.0061,
0,
0.66,
0.2,
666,
0,
6,
0,
0,
666,
0,
0
],
[
1,
0,
0.0545,
0.0061,
0,
0.66,
... | [
"'''\nCreated on 2009-11-23\n\n@author: beaudoin\n'''",
"import wx, GLUtils, PyUtils, Core, Physics, Controllers",
"from CharacterDescription import CharacterDescription",
"from CharacterScaler import CharacterScalerFront",
"from ToolSet import ToolSet",
"class Model(object):\n \n def __init__(self)... |
from Model import Model
from CharacterDescription import CharacterDescription
from CharacterScaler import CharacterScalerFront
from ToolSet import ToolSet | [
[
1,
0,
0.25,
0.25,
0,
0.66,
0,
929,
0,
1,
0,
0,
929,
0,
0
],
[
1,
0,
0.5,
0.25,
0,
0.66,
0.3333,
869,
0,
1,
0,
0,
869,
0,
0
],
[
1,
0,
0.75,
0.25,
0,
0.66,
0.6... | [
"from Model import Model",
"from CharacterDescription import CharacterDescription",
"from CharacterScaler import CharacterScalerFront",
"from ToolSet import ToolSet"
] |
'''
Created on 2009-11-23
@author: beaudoin
'''
import UI, wx
class ToolSet(UI.ToolSets.ToolsetBase):
def __init__(self, toolPanel, model):
"""Adds a tool set for the instant character to a toolpanel."""
super(ToolSet,self).__init__()
self._t... | [
[
8,
0,
0.0667,
0.1111,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1556,
0.0222,
0,
0.66,
0.5,
587,
0,
2,
0,
0,
587,
0,
0
],
[
3,
0,
0.6111,
0.8,
0,
0.66,
... | [
"'''\nCreated on 2009-11-23\n\n@author: beaudoin\n'''",
"import UI, wx",
"class ToolSet(UI.ToolSets.ToolsetBase):\n \n def __init__(self, toolPanel, model):\n \"\"\"Adds a tool set for the instant character to a toolpanel.\"\"\"\n \n super(ToolSet,self).__init__()\n \n ... |
'''
Created on 2009-09-02
@author: beaudoin
'''
import Proxy, Member
import App
cls = App.ObservableList
ObservableList = Proxy.create( cls,
members = [
Member.ObjectList( 'objects', None, cls.get, cls.getCount, cls.add, embedInParentNode = True ),
] )
cls = App.SnapshotBranch
Sn... | [
[
8,
0,
0.0968,
0.1613,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2258,
0.0323,
0,
0.66,
0.125,
363,
0,
2,
0,
0,
363,
0,
0
],
[
1,
0,
0.2581,
0.0323,
0,
0.66,... | [
"'''\nCreated on 2009-09-02\n\n@author: beaudoin\n'''",
"import Proxy, Member",
"import App",
"cls = App.ObservableList",
"ObservableList = Proxy.create( cls, \n members = [\n Member.ObjectList( 'objects', None, cls.get, cls.getCount, cls.add, embedInParentNode = True ),\n ] )",
"cls = App.Sn... |
'''
Created on 2009-09-22
@author: beaudoin
This module contains classes representing different possible type of data members within proxy object.
A member knows how to get/set itself from/to the wrapped object.
'''
import MathLib
import PyUtils
class TopLevel(object):
def __init__(self, type... | [
[
8,
0,
0.0206,
0.0367,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0459,
0.0046,
0,
0.66,
0.0833,
209,
0,
1,
0,
0,
209,
0,
0
],
[
1,
0,
0.0505,
0.0046,
0,
0.66... | [
"'''\nCreated on 2009-09-22\n\n@author: beaudoin\n\nThis module contains classes representing different possible type of data members within proxy object.\nA member knows how to get/set itself from/to the wrapped object.\n'''",
"import MathLib",
"import PyUtils",
"class TopLevel(object):\n \n def __init... |
'''
Created on 2009-09-03
@author: beaudoin
'''
import Proxy
import Member
import Physics
def getArb(af, arbName):
if arbName is None : return None
arb = af.getARBByName( arbName )
if arb is None:
raise KeyError( "Articulated rigid body '"+arbName+"' not found in articulated fi... | [
[
8,
0,
0.0435,
0.0725,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1159,
0.0145,
0,
0.66,
0.0556,
363,
0,
1,
0,
0,
363,
0,
0
],
[
1,
0,
0.1304,
0.0145,
0,
0.66... | [
"'''\nCreated on 2009-09-03\n\n@author: beaudoin\n'''",
"import Proxy",
"import Member",
"import Physics",
"def getArb(af, arbName):\n if arbName is None : return None\n arb = af.getARBByName( arbName )\n if arb is None: \n raise KeyError( \"Articulated rigid body '\"+arbName+\"' not found i... |
'''
Created on 2009-09-24
@author: beaudoin
'''
import Utils, wx, PyUtils
import Member
from UI.InfoTree import getIconIndex
class NodeData(Utils.Observer):
"""
This class wraps one object presented in a node of the tree.
The wrapped object must be observable (either derived from Utils.O... | [
[
8,
0,
0.0121,
0.0202,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0283,
0.004,
0,
0.66,
0.1,
842,
0,
3,
0,
0,
842,
0,
0
],
[
1,
0,
0.0324,
0.004,
0,
0.66,
... | [
"'''\nCreated on 2009-09-24\n\n@author: beaudoin\n'''",
"import Utils, wx, PyUtils",
"import Member",
"from UI.InfoTree import getIconIndex",
"class NodeData(Utils.Observer):\n \"\"\"\n This class wraps one object presented in a node of the tree.\n The wrapped object must be observable (either deri... |
'''
Created on 2009-09-03
@author: beaudoin
'''
import Proxy
import Member
from PyUtils import enum
import Controllers
import wx, Core
def getControlParams(controller, i):
if i == 0 :
return controller.getRootControlParams()
else :
return controller.getControlParams(i-1)
... | [
[
8,
0,
0.0156,
0.026,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0365,
0.0052,
0,
0.66,
0.0222,
363,
0,
1,
0,
0,
363,
0,
0
],
[
1,
0,
0.0417,
0.0052,
0,
0.66,... | [
"'''\nCreated on 2009-09-03\n\n@author: beaudoin\n'''",
"import Proxy",
"import Member",
"from PyUtils import enum",
"import Controllers",
"import wx, Core",
"def getControlParams(controller, i):\n if i == 0 :\n return controller.getRootControlParams()\n else :\n return controller.ge... |
'''
Created on 2009-09-22
@author: beaudoin
'''
import PyUtils
def create( wrappedClass = None, members = [], parent = None, caster = None, loader = None, verbose = True, icon = None, nameGetter = None ):
"""
Creates a new proxy class (NOT an instance).
This proxy class is meant as a wra... | [
[
8,
0,
0.0129,
0.0216,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0302,
0.0043,
0,
0.66,
0.3333,
806,
0,
1,
0,
0,
806,
0,
0
],
[
2,
0,
0.1078,
0.1422,
0,
0.66... | [
"'''\nCreated on 2009-09-22\n\n@author: beaudoin\n'''",
"import PyUtils",
"def create( wrappedClass = None, members = [], parent = None, caster = None, loader = None, verbose = True, icon = None, nameGetter = None ):\n \"\"\"\n Creates a new proxy class (NOT an instance).\n \n This proxy class is me... |
'''
Created on 2009-09-02
@author: beaudoin
'''
import Proxy
import Member
import Physics
cls = Physics.SphereCDP
SphereCDP = Proxy.create( cls, verbose = False, caster = Physics.castToSphereCDP,
members = [
Member.Point3d( 'center', (0.0,0.0,0.0), cls.getCenter, cls.setCenter ),
Me... | [
[
8,
0,
0.0769,
0.1282,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1795,
0.0256,
0,
0.66,
0.0909,
363,
0,
1,
0,
0,
363,
0,
0
],
[
1,
0,
0.2051,
0.0256,
0,
0.66... | [
"'''\nCreated on 2009-09-02\n\n@author: beaudoin\n'''",
"import Proxy",
"import Member",
"import Physics",
"cls = Physics.SphereCDP",
"SphereCDP = Proxy.create( cls, verbose = False, caster = Physics.castToSphereCDP,\n members = [\n Member.Point3d( 'center', (0.0,0.0,0.0), cls.getCenter, cls.set... |
from SNMApp import ObservableList, SnapshotBranch, Snapshot
from CDPs import SphereCDP, BoxCDP, PlaneCDP, CapsuleCDP
from RigidBody import RigidBody, ArticulatedRigidBody
from ArticulatedFigure import ArticulatedFigure, Character
from Joints import BallInSocketJoint, UniversalJoint, HingeJoint, StiffJoint
from Sim... | [
[
1,
0,
0.1667,
0.1667,
0,
0.66,
0,
323,
0,
3,
0,
0,
323,
0,
0
],
[
1,
0,
0.3333,
0.1667,
0,
0.66,
0.2,
831,
0,
4,
0,
0,
831,
0,
0
],
[
1,
0,
0.5,
0.1667,
0,
0.66,
... | [
"from SNMApp import ObservableList, SnapshotBranch, Snapshot",
"from CDPs import SphereCDP, BoxCDP, PlaneCDP, CapsuleCDP",
"from RigidBody import RigidBody, ArticulatedRigidBody",
"from ArticulatedFigure import ArticulatedFigure, Character",
"from Joints import BallInSocketJoint, UniversalJoint, HingeJoint,... |
'''
Created on 2009-09-03
@author: beaudoin
'''
import Proxy
import Member
import Physics, Core, wx
cls = Physics.ArticulatedFigure
ArticulatedFigure = Proxy.create( cls, loader = Physics.world().addArticulatedFigure,
members = [
Member.Basic( str, 'name', 'UnnamedArticulatedFigure', cls.g... | [
[
8,
0,
0.1364,
0.2273,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.3182,
0.0455,
0,
0.66,
0.1429,
363,
0,
1,
0,
0,
363,
0,
0
],
[
1,
0,
0.3636,
0.0455,
0,
0.66... | [
"'''\nCreated on 2009-09-03\n\n@author: beaudoin\n'''",
"import Proxy",
"import Member",
"import Physics, Core, wx",
"cls = Physics.ArticulatedFigure",
"ArticulatedFigure = Proxy.create( cls, loader = Physics.world().addArticulatedFigure,\n members = [\n Member.Basic( str, 'name', 'UnnamedArticu... |
from SNMApp import SNMApp
from SnapshotTree import SnapshotBranch, Snapshot
from ObservableList import ObservableList
import Scenario
import InstantChar
import KeyframeEditor | [
[
1,
0,
0.1667,
0.1667,
0,
0.66,
0,
323,
0,
1,
0,
0,
323,
0,
0
],
[
1,
0,
0.3333,
0.1667,
0,
0.66,
0.2,
965,
0,
2,
0,
0,
965,
0,
0
],
[
1,
0,
0.5,
0.1667,
0,
0.66,
... | [
"from SNMApp import SNMApp",
"from SnapshotTree import SnapshotBranch, Snapshot",
"from ObservableList import ObservableList",
"import Scenario",
"import InstantChar",
"import KeyframeEditor"
] |
'''
Created on 2009-10-06
@author: beaudoin
'''
import Scenario, PyUtils, Physics, MathLib, math
class Staircase(Scenario.Scenario):
"""A scenario that can be used to setup a staircase."""
def __init__(self, name = "Staircase scenario", staircaseWidth = 0.9, threadDepth = 0.2 , riserHeight = ... | [
[
8,
0,
0.0201,
0.0336,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.047,
0.0067,
0,
0.66,
0.5,
700,
0,
5,
0,
0,
700,
0,
0
],
[
3,
0,
0.5067,
0.8993,
0,
0.66,
... | [
"'''\nCreated on 2009-10-06\n\n@author: beaudoin\n'''",
"import Scenario, PyUtils, Physics, MathLib, math",
"class Staircase(Scenario.Scenario):\n \"\"\"A scenario that can be used to setup a staircase.\"\"\"\n \n def __init__(self, name = \"Staircase scenario\", staircaseWidth = 0.9, threadDepth = 0.2... |
'''
Created on 2009-10-06
@author: beaudoin
'''
import PyUtils
class Scenario(PyUtils.Observable):
"""The base class for a scenario. Each scenarios should have the following methods:
load()
Called when the scenario has been filled so that its resources can be created (like rigid... | [
[
8,
0,
0.0938,
0.1562,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2188,
0.0312,
0,
0.66,
0.5,
806,
0,
1,
0,
0,
806,
0,
0
],
[
3,
0,
0.6406,
0.75,
0,
0.66,
... | [
"'''\nCreated on 2009-10-06\n\n@author: beaudoin\n'''",
"import PyUtils",
"class Scenario(PyUtils.Observable):\n \"\"\"The base class for a scenario. Each scenarios should have the following methods:\n load()\n Called when the scenario has been filled so that its resources can be created... |
from Staircase import Staircase | [
[
1,
0,
1,
1,
0,
0.66,
0,
849,
0,
1,
0,
0,
849,
0,
0
]
] | [
"from Staircase import Staircase"
] |
'''
Created on 2009-12-02
@author: beaudoin
'''
from OpenGL.GL import *
import UI, Core, GLUtils
from MathLib import Point3d, Vector3d, Quaternion
import math
class CheckBoxCallback(GLUtils.GLUICallback):
def __init__(self, editorWindow):
"""Private callback class."""
super(Ch... | [
[
8,
0,
0.0085,
0.0142,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0199,
0.0028,
0,
0.66,
0.0588,
280,
0,
1,
0,
0,
280,
0,
0
],
[
1,
0,
0.0228,
0.0028,
0,
0.66... | [
"'''\nCreated on 2009-12-02\n\n@author: beaudoin\n'''",
"from OpenGL.GL import *",
"import UI, Core, GLUtils",
"from MathLib import Point3d, Vector3d, Quaternion",
"import math",
"class CheckBoxCallback(GLUtils.GLUICallback):\n \n def __init__(self, editorWindow):\n \"\"\"Private callback cla... |
'''
Created on 2009-12-08
@author: beaudoin
'''
import Core
from MathLib import Vector3d, Point3d, Quaternion
import math
class PosableCharacter(object):
"""A character that can be posed and edited in the keyframe editor."""
def __init__(self, character, controller):
"""Initializes... | [
[
8,
0,
0.0164,
0.0273,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0383,
0.0055,
0,
0.66,
0.25,
463,
0,
1,
0,
0,
463,
0,
0
],
[
1,
0,
0.0437,
0.0055,
0,
0.66,
... | [
"'''\nCreated on 2009-12-08\n\n@author: beaudoin\n'''",
"import Core",
"from MathLib import Vector3d, Point3d, Quaternion",
"import math",
"class PosableCharacter(object):\n \"\"\"A character that can be posed and edited in the keyframe editor.\"\"\"\n \n def __init__(self, character, controller):\... |
'''
Created on 2009-12-02
@author: beaudoin
'''
import math, MathLib
class BaseHandle(object):
def __init__( self, trajectory, oppositeTrajectory = None, reverseOppositeJoint = False, minValue = -1000, maxValue = 1000 ):
"""
Creates a handle that can be manipulated and ... | [
[
8,
0,
0.0205,
0.0342,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0479,
0.0068,
0,
0.66,
0.3333,
526,
0,
2,
0,
0,
526,
0,
0
],
[
3,
0,
0.3801,
0.6301,
0,
0.66... | [
"'''\nCreated on 2009-12-02\n\n@author: beaudoin\n'''",
"import math, MathLib",
"class BaseHandle(object):\n \n def __init__( self, trajectory, oppositeTrajectory = None, reverseOppositeJoint = False, minValue = -1000, maxValue = 1000 ):\n \"\"\"\n Creates a handle that can be manipulated an... |
'''
Created on 2009-12-02
@author: beaudoin
'''
import wx, PyUtils, GLUtils
from Handle import BaseHandle, Handle
from PosableCharacter import PosableCharacter
from ToolSet import ToolSet
from EditorWindow import EditorWindow
from MathLib import Vector3d, Point3d, Trajectory3dv
class Model(object):
... | [
[
8,
0,
0.0144,
0.0239,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0335,
0.0048,
0,
0.66,
0.125,
666,
0,
3,
0,
0,
666,
0,
0
],
[
1,
0,
0.0383,
0.0048,
0,
0.66,... | [
"'''\nCreated on 2009-12-02\n\n@author: beaudoin\n'''",
"import wx, PyUtils, GLUtils",
"from Handle import BaseHandle, Handle",
"from PosableCharacter import PosableCharacter",
"from ToolSet import ToolSet",
"from EditorWindow import EditorWindow",
"from MathLib import Vector3d, Point3d, Trajectory3dv",... |
from Model import Model
| [
[
1,
0,
1,
1,
0,
0.66,
0,
929,
0,
1,
0,
0,
929,
0,
0
]
] | [
"from Model import Model"
] |
'''
Created on 2009-11-23
@author: beaudoin
'''
import UI, wx
class ToolSet(UI.ToolSets.ToolsetBase):
def __init__(self, toolPanel, model):
"""Adds a tool set for the keyframe editor to a toolpanel."""
super(ToolSet,self).__init__()
self._too... | [
[
8,
0,
0.1154,
0.1923,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2692,
0.0385,
0,
0.66,
0.5,
587,
0,
2,
0,
0,
587,
0,
0
],
[
3,
0,
0.6923,
0.6538,
0,
0.66,
... | [
"'''\nCreated on 2009-11-23\n\n@author: beaudoin\n'''",
"import UI, wx",
"class ToolSet(UI.ToolSets.ToolsetBase):\n \n def __init__(self, toolPanel, model):\n \"\"\"Adds a tool set for the keyframe editor to a toolpanel.\"\"\"\n \n super(ToolSet,self).__init__()\n \n ... |
'''
Created on 2009-09-08
@author: beaudoin
Contains a abstract syntactic tree visitor for printing
nested function calls in a nice way. Used for cleaning-up
output of the serialize method.
See the python standard ast module for details.
'''
import ast
class Fancify( ast.NodeVisitor ):
de... | [
[
8,
0,
0.0606,
0.1111,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1313,
0.0101,
0,
0.66,
0.5,
809,
0,
1,
0,
0,
809,
0,
0
],
[
3,
0,
0.5606,
0.8283,
0,
0.66,
... | [
"'''\nCreated on 2009-09-08\n\n@author: beaudoin\n\nContains a abstract syntactic tree visitor for printing\nnested function calls in a nice way. Used for cleaning-up \noutput of the serialize method.",
"import ast",
"class Fancify( ast.NodeVisitor ):\n \n def __init__(self):\n super( Fancify, self... |
'''
Created on 2009-10-06
@author: beaudoin
A collection of useful functions for creating stock rigid bodies
'''
import Physics, MathLib, Mesh, PyUtils, math
from MathLib import Point3d, Vector3d
def createBox( size=(1,1,1), colour=(0.6,0.6,0.6), moiScale = 1, withMesh = True, **kwargs ):
"""
... | [
[
8,
0,
0.0108,
0.0189,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0243,
0.0027,
0,
0.66,
0.0556,
347,
0,
5,
0,
0,
347,
0,
0
],
[
1,
0,
0.027,
0.0027,
0,
0.66,... | [
"'''\nCreated on 2009-10-06\n\n@author: beaudoin\n\nA collection of useful functions for creating stock rigid bodies\n'''",
"import Physics, MathLib, Mesh, PyUtils, math",
"from MathLib import Point3d, Vector3d",
"def createBox( size=(1,1,1), colour=(0.6,0.6,0.6), moiScale = 1, withMesh = True, **kwargs ):\n ... |
'''
Created on 2009-09-16
@author: beaudoin
A Python version of the C++ Observable class found in Utils
'''
class Observable(object):
def __init__(self):
self._observers = []
self._hasChanged = False
self._batchChangeDepth = 0
def setChanged(self):
... | [
[
8,
0,
0.0513,
0.0897,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
3,
0,
0.5577,
0.8974,
0,
0.66,
1,
546,
0,
13,
0,
0,
186,
0,
10
],
[
2,
1,
0.1603,
0.0513,
1,
0.19,
... | [
"'''\nCreated on 2009-09-16\n\n@author: beaudoin\n\nA Python version of the C++ Observable class found in Utils \n'''",
"class Observable(object):\n \n def __init__(self):\n self._observers = []\n self._hasChanged = False\n self._batchChangeDepth = 0\n \n def setChanged(self):... |
'''
Created on 2009-09-02
@author: beaudoin
'''
def callOnObjectOrList( objectOrList, function ):
"""Apply the specified function on :
- The single element passed as first parameter
- The list of elements passed as first parameter, if this is a list or tuple
- The list of values ... | [
[
8,
0,
0.0091,
0.0152,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.0409,
0.0424,
0,
0.66,
0.0323,
564,
0,
2,
0,
0,
0,
0,
6
],
[
8,
1,
0.0318,
0.0182,
1,
0.78,
... | [
"'''\nCreated on 2009-09-02\n\n@author: beaudoin\n'''",
"def callOnObjectOrList( objectOrList, function ):\n \"\"\"Apply the specified function on :\n - The single element passed as first parameter\n - The list of elements passed as first parameter, if this is a list or tuple\n - The list ... |
from Utils import *
from Enum import enum
from Observable import Observable
import Mesh
import RigidBody | [
[
1,
0,
0.2,
0.2,
0,
0.66,
0,
842,
0,
1,
0,
0,
842,
0,
0
],
[
1,
0,
0.4,
0.2,
0,
0.66,
0.25,
575,
0,
1,
0,
0,
575,
0,
0
],
[
1,
0,
0.6,
0.2,
0,
0.66,
0.5,
5... | [
"from Utils import *",
"from Enum import enum",
"from Observable import Observable",
"import Mesh",
"import RigidBody"
] |
'''
Created on 2009-10-06
@author: beaudoin
A collection of useful functions for creating stock meshes
'''
import GLUtils, PyUtils, MathLib, math
from MathLib import Point3d, Vector3d
def create( vertices, faces, colour=(0.6,0.6,0.6) ):
"""
Creates a mesh having the specified vertices and faces... | [
[
8,
0,
0.0191,
0.0335,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0431,
0.0048,
0,
0.66,
0.1111,
810,
0,
4,
0,
0,
810,
0,
0
],
[
1,
0,
0.0478,
0.0048,
0,
0.66... | [
"'''\nCreated on 2009-10-06\n\n@author: beaudoin\n\nA collection of useful functions for creating stock meshes\n'''",
"import GLUtils, PyUtils, MathLib, math",
"from MathLib import Point3d, Vector3d",
"def create( vertices, faces, colour=(0.6,0.6,0.6) ):\n \"\"\"\n Creates a mesh having the specified ve... |
'''
Created on 2009-09-28
@author: beaudoin
'''
def enum( *args ):
"""
Creates an enum class.
Pass a dictionnary { choice : value, ... }
Here, choice needs to be a string and value is an integer
Can also pass a list or a tuple, then the values will be given automatically, starting a... | [
[
8,
0,
0.0283,
0.0472,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
2,
0,
0.533,
0.9245,
0,
0.66,
1,
820,
0,
1,
1,
0,
0,
0,
22
],
[
8,
1,
0.1651,
0.1698,
1,
0.51,
0... | [
"'''\nCreated on 2009-09-28\n\n@author: beaudoin\n'''",
"def enum( *args ):\n \"\"\"\n Creates an enum class. \n Pass a dictionnary { choice : value, ... }\n Here, choice needs to be a string and value is an integer\n Can also pass a list or a tuple, then the values will be given automatically, st... |
'''
Created on 2009-11-27
@author: beaudoin
'''
import Core
import random, math
from MathLib import Point3d, Vector3d
class WalkController(Core.IKVMCController):
def __init__(self, character):
super(WalkController,self).__init__(character)
def typeName(self):
ret... | [
[
8,
0,
0.0337,
0.0562,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0787,
0.0112,
0,
0.66,
0.25,
463,
0,
1,
0,
0,
463,
0,
0
],
[
1,
0,
0.0899,
0.0112,
0,
0.66,
... | [
"'''\nCreated on 2009-11-27\n\n@author: beaudoin\n'''",
"import Core",
"import random, math",
"from MathLib import Point3d, Vector3d",
"class WalkController(Core.IKVMCController):\n \n def __init__(self, character):\n super(WalkController,self).__init__(character)\n \n def typeName(se... |
'''
Created on 2009-11-27
@author: beaudoin
'''
import Core
import random, math
from MathLib import Point3d, Vector3d
class DanceController(Core.IKVMCController):
def __init__(self, character):
super(DanceController,self).__init__(character)
def typeName(self):
r... | [
[
8,
0,
0.0143,
0.0238,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0333,
0.0048,
0,
0.66,
0.25,
463,
0,
1,
0,
0,
463,
0,
0
],
[
1,
0,
0.0381,
0.0048,
0,
0.66,
... | [
"'''\nCreated on 2009-11-27\n\n@author: beaudoin\n'''",
"import Core",
"import random, math",
"from MathLib import Point3d, Vector3d",
"class DanceController(Core.IKVMCController):\n \n def __init__(self, character):\n super(DanceController,self).__init__(character)\n \n def typeName(... |
from DanceController import DanceController
from WalkController import WalkController | [
[
1,
0,
0.5,
0.5,
0,
0.66,
0,
456,
0,
1,
0,
0,
456,
0,
0
],
[
1,
0,
1,
0.5,
0,
0.66,
1,
293,
0,
1,
0,
0,
293,
0,
0
]
] | [
"from DanceController import DanceController",
"from WalkController import WalkController"
] |
import Utils
Utils.test() | [
[
1,
0,
0.3333,
0.3333,
0,
0.66,
0,
842,
0,
1,
0,
0,
842,
0,
0
],
[
8,
0,
1,
0.3333,
0,
0.66,
1,
224,
3,
0,
0,
0,
0,
0,
1
]
] | [
"import Utils",
"Utils.test()"
] |
'''
Created on 2009-09-26
@author: beaudoin
'''
import wx, UI
class Animation(object):
# Available speeds on the buttons
_buttonSpeeds = ( '1/16', '1/8', '1/4', '1/2', '1', '2', '4' )
def __init__(self, toolPanel):
"""Adds a tool set for animation information to a toolpanel.""... | [
[
8,
0,
0.0366,
0.061,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0854,
0.0122,
0,
0.66,
0.3333,
666,
0,
2,
0,
0,
666,
0,
0
],
[
3,
0,
0.4817,
0.7561,
0,
0.66,... | [
"'''\nCreated on 2009-09-26\n\n@author: beaudoin\n'''",
"import wx, UI",
"class Animation(object):\n \n # Available speeds on the buttons\n _buttonSpeeds = ( '1/16', '1/8', '1/4', '1/2', '1', '2', '4' )\n\n def __init__(self, toolPanel):\n \"\"\"Adds a tool set for animation information to a ... |
'''
Created on 2009-10-02
@author: beaudoin
'''
import wx, UI, PyUtils
class SnapshotTree(object):
def __init__(self, toolPanel):
"""Adds a tool set for animation information to a toolpanel."""
self._toolPanel = toolPanel
self._toolSet = toolPanel.createToolSet( "Snapsho... | [
[
8,
0,
0.0309,
0.0515,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0722,
0.0103,
0,
0.66,
0.5,
666,
0,
3,
0,
0,
666,
0,
0
],
[
3,
0,
0.5412,
0.9072,
0,
0.66,
... | [
"'''\nCreated on 2009-10-02\n\n@author: beaudoin\n'''",
"import wx, UI, PyUtils",
"class SnapshotTree(object):\n \n def __init__(self, toolPanel):\n \"\"\"Adds a tool set for animation information to a toolpanel.\"\"\"\n self._toolPanel = toolPanel\n self._toolSet = toolPanel.createTo... |
'''
Created on 2009-09-26
@author: beaudoin
'''
import UI, wx, math
class _OptionData(object):
def __init__(self, checkBox, getter, setter):
self.checkBox = checkBox
self.getter = getter
self.setter = setter
self.update()
def update(self):
... | [
[
8,
0,
0.0291,
0.0485,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.068,
0.0097,
0,
0.66,
0.25,
587,
0,
3,
0,
0,
587,
0,
0
],
[
3,
0,
0.1456,
0.1262,
0,
0.66,
... | [
"'''\nCreated on 2009-09-26\n\n@author: beaudoin\n'''",
"import UI, wx, math",
"class _OptionData(object):\n \n def __init__(self, checkBox, getter, setter):\n self.checkBox = checkBox\n self.getter = getter\n self.setter = setter\n self.update()",
" def __init__(self, che... |
'''
Created on 2009-09-26
@author: beaudoin
'''
import UI, wx
from ToolsetBase import ToolsetBase
class Options(ToolsetBase):
def __init__(self, toolPanel):
"""Adds a tool set for various options information to a toolpanel."""
super(Options, self).__init__()
... | [
[
8,
0,
0.1,
0.1667,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2333,
0.0333,
0,
0.66,
0.3333,
587,
0,
2,
0,
0,
587,
0,
0
],
[
1,
0,
0.2667,
0.0333,
0,
0.66,
... | [
"'''\nCreated on 2009-09-26\n\n@author: beaudoin\n'''",
"import UI, wx",
"from ToolsetBase import ToolsetBase",
"class Options(ToolsetBase):\n \n def __init__(self, toolPanel):\n \"\"\"Adds a tool set for various options information to a toolpanel.\"\"\"\n \n super(Options, self).__... |
'''
Created on 2009-09-26
@author: beaudoin
'''
import UI, wx
from ToolsetBase import ToolsetBase
class Camera(ToolsetBase):
def __init__(self, toolPanel):
"""Adds a tool set for camera information to a toolpanel."""
super(Camera, self).__init__()
se... | [
[
8,
0,
0.1034,
0.1724,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.2414,
0.0345,
0,
0.66,
0.3333,
587,
0,
2,
0,
0,
587,
0,
0
],
[
1,
0,
0.2759,
0.0345,
0,
0.66... | [
"'''\nCreated on 2009-09-26\n\n@author: beaudoin\n'''",
"import UI, wx",
"from ToolsetBase import ToolsetBase",
"class Camera(ToolsetBase):\n \n def __init__(self, toolPanel):\n \"\"\"Adds a tool set for camera information to a toolpanel.\"\"\"\n \n super(Camera, self).__init__()\n ... |
'''
Created on 2009-09-26
@author: beaudoin
'''
import UI, wx, PyUtils, os, Core
class ControllerTree(object):
"""A toolset that can be used to display an editable tree of the loaded controllers."""
def __init__(self, toolPanel):
"""Adds a tool set that display a tree of controllers ... | [
[
8,
0,
0.0106,
0.0177,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0247,
0.0035,
0,
0.66,
0.3333,
587,
0,
5,
0,
0,
587,
0,
0
],
[
3,
0,
0.0671,
0.0742,
0,
0.66... | [
"'''\nCreated on 2009-09-26\n\n@author: beaudoin\n'''",
"import UI, wx, PyUtils, os, Core",
"class ControllerTree(object):\n \"\"\"A toolset that can be used to display an editable tree of the loaded controllers.\"\"\"\n \n def __init__(self, toolPanel):\n \"\"\"Adds a tool set that display a tr... |
from ToolsetBase import ToolsetBase
from ControllerTree import ControllerTree
from Animation import Animation
from Options import Options
from Camera import Camera
from SnapshotTree import SnapshotTree | [
[
1,
0,
0.1667,
0.1667,
0,
0.66,
0,
177,
0,
1,
0,
0,
177,
0,
0
],
[
1,
0,
0.3333,
0.1667,
0,
0.66,
0.2,
389,
0,
1,
0,
0,
389,
0,
0
],
[
1,
0,
0.5,
0.1667,
0,
0.66,
... | [
"from ToolsetBase import ToolsetBase",
"from ControllerTree import ControllerTree",
"from Animation import Animation",
"from Options import Options",
"from Camera import Camera",
"from SnapshotTree import SnapshotTree"
] |
'''
Created on 2009-08-30
@author: beaudoin
Allows creation of a vertical collection of collapsible tool sets
'''
import wx
class ToolSet(wx.Panel):
"""A simple class that maintain tools and that can be hidden or showed."""
_triUp = None
_triDown = None
def __init__(sel... | [
[
8,
0,
0.0241,
0.0422,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0542,
0.006,
0,
0.66,
0.3333,
666,
0,
1,
0,
0,
666,
0,
0
],
[
3,
0,
0.4518,
0.7771,
0,
0.66,... | [
"'''\nCreated on 2009-08-30\n\n@author: beaudoin\n\nAllows creation of a vertical collection of collapsible tool sets\n'''",
"import wx",
"class ToolSet(wx.Panel):\n \"\"\"A simple class that maintain tools and that can be hidden or showed.\"\"\"\n _triUp = None\n _triDown = None \n \n d... |
'''
Created on 2009-09-30
@author: beaudoin
'''
import wx, GLUtils, PyUtils
class CurveEditorCollection(GLUtils.GLUIContainer):
"""A collection of curve editor that observes the curve editors of the application."""
def __init__( self, parent, x=0, y=0, width=0, height=0, minWidth=-1, minHei... | [
[
8,
0,
0.0361,
0.0602,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0964,
0.012,
0,
0.66,
0.5,
666,
0,
3,
0,
0,
666,
0,
0
],
[
3,
0,
0.5602,
0.8916,
0,
0.66,
... | [
"'''\nCreated on 2009-09-30\n\n@author: beaudoin\n'''",
"import wx, GLUtils, PyUtils",
"class CurveEditorCollection(GLUtils.GLUIContainer):\n \"\"\"A collection of curve editor that observes the curve editors of the application.\"\"\"\n \n def __init__( self, parent, x=0, y=0, width=0, height=0, minWid... |
'''
Created on 2009-12-02
@author: beaudoin
'''
import GLUtils
from OpenGL.GL import *
class ControlPoint(object):
"""Base class for any type of control point.
Derived classes must implement:
getPos() returns the x, y position of the control point."""
def __init__( self ):... | [
[
8,
0,
0.0168,
0.0279,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0391,
0.0056,
0,
0.66,
0.25,
810,
0,
1,
0,
0,
810,
0,
0
],
[
1,
0,
0.0447,
0.0056,
0,
0.66,
... | [
"'''\nCreated on 2009-12-02\n\n@author: beaudoin\n'''",
"import GLUtils",
"from OpenGL.GL import *",
"class ControlPoint(object):\n \"\"\"Base class for any type of control point. \n Derived classes must implement:\n getPos() returns the x, y position of the control point.\"\"\"\n \n de... |
from CurveEditorCollection import CurveEditorCollection
from WindowWithControlPoints import WindowWithControlPoints, ControlPoint | [
[
1,
0,
0.5,
0.5,
0,
0.66,
0,
795,
0,
1,
0,
0,
795,
0,
0
],
[
1,
0,
1,
0.5,
0,
0.66,
1,
647,
0,
2,
0,
0,
647,
0,
0
]
] | [
"from CurveEditorCollection import CurveEditorCollection",
"from WindowWithControlPoints import WindowWithControlPoints, ControlPoint"
] |
'''
Created on 2009-08-24
This module contains the main OpenGL application window that is used by all SNM applications
@author: beaudoin
'''
import wx
import UI
class MainWindow(wx.Frame):
"""The class for the main window."""
MIN_TOOLPANEL_WIDTH = 200
MIN_CONSOLE_HEIGHT = 100
... | [
[
8,
0,
0.0265,
0.0464,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0596,
0.0066,
0,
0.66,
0.3333,
666,
0,
1,
0,
0,
666,
0,
0
],
[
1,
0,
0.0662,
0.0066,
0,
0.66... | [
"'''\nCreated on 2009-08-24\n\nThis module contains the main OpenGL application window that is used by all SNM applications\n\n@author: beaudoin\n'''",
"import wx",
"import UI",
"class MainWindow(wx.Frame):\n \"\"\"The class for the main window.\"\"\"\n MIN_TOOLPANEL_WIDTH = 200\n MIN_CONSOLE_HEIGHT ... |
'''
Created on 2009-09-24
@author: beaudoin
'''
import Utils, wx
import PyUtils
class MemberDisplay(Utils.Observer):
"""
This class wraps an element and displays its content in a table with a grid sizer
"""
def __init__(self, table, sizer):
super(MemberDisplay,self).__i... | [
[
8,
0,
0.03,
0.05,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.07,
0.01,
0,
0.66,
0.3333,
842,
0,
2,
0,
0,
842,
0,
0
],
[
1,
0,
0.08,
0.01,
0,
0.66,
0.6667... | [
"'''\nCreated on 2009-09-24\n\n@author: beaudoin\n'''",
"import Utils, wx",
"import PyUtils",
"class MemberDisplay(Utils.Observer):\n \"\"\"\n This class wraps an element and displays its content in a table with a grid sizer\n \"\"\"\n \n def __init__(self, table, sizer):\n super(MemberD... |
'''
Created on 2009-10-08
@author: beaudoin
'''
import wx
class ToggleBitmapButton(wx.BitmapButton):
def __init__(self, parent, id=wx.ID_ANY, bitmap=wx.NullBitmap, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.BU_AUTODRAW, validator=wx.DefaultValidator, name=wx.ButtonNameStr, selected=Fals... | [
[
8,
0,
0.0448,
0.0746,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1045,
0.0149,
0,
0.66,
0.5,
666,
0,
1,
0,
0,
666,
0,
0
],
[
3,
0,
0.5373,
0.8209,
0,
0.66,
... | [
"'''\nCreated on 2009-10-08\n\n@author: beaudoin\n'''",
"import wx",
"class ToggleBitmapButton(wx.BitmapButton):\n \n def __init__(self, parent, id=wx.ID_ANY, bitmap=wx.NullBitmap, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.BU_AUTODRAW, validator=wx.DefaultValidator, name=wx.ButtonNameStr, sele... |
from ToggleBitmapButton import ToggleBitmapButton | [
[
1,
0,
1,
1,
0,
0.66,
0,
45,
0,
1,
0,
0,
45,
0,
0
]
] | [
"from ToggleBitmapButton import ToggleBitmapButton"
] |
import ToolSets
import GLUITools
import Ext
from InfoTree import InfoTreeBasic, InfoTree
from GLPanel import GLPanel
from PythonConsole import PythonConsole
from ToolPanel import ToolPanel
from MainWindow import MainWindow
| [
[
1,
0,
0.1111,
0.1111,
0,
0.66,
0,
262,
0,
1,
0,
0,
262,
0,
0
],
[
1,
0,
0.2222,
0.1111,
0,
0.66,
0.1429,
486,
0,
1,
0,
0,
486,
0,
0
],
[
1,
0,
0.3333,
0.1111,
0,
... | [
"import ToolSets",
"import GLUITools",
"import Ext",
"from InfoTree import InfoTreeBasic, InfoTree",
"from GLPanel import GLPanel",
"from PythonConsole import PythonConsole",
"from ToolPanel import ToolPanel",
"from MainWindow import MainWindow"
] |
'''
Created on 2009-09-14
@author: beaudoin
'''
import wx
import Utils
from MemberDisplay import MemberDisplay
# Unique list for all the images
_iconList = None
_iconDict = {}
_unknownIcon = '../data/ui/unknownIcon.png'
def _getIconList():
global _iconList
if _iconList is None :
_... | [
[
8,
0,
0.0147,
0.0245,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0343,
0.0049,
0,
0.66,
0.0909,
666,
0,
1,
0,
0,
666,
0,
0
],
[
1,
0,
0.0392,
0.0049,
0,
0.66... | [
"'''\nCreated on 2009-09-14\n\n@author: beaudoin\n'''",
"import wx",
"import Utils",
"from MemberDisplay import MemberDisplay",
"_iconList = None",
"_iconDict = {}",
"_unknownIcon = '../data/ui/unknownIcon.png'",
"def _getIconList():\n global _iconList\n if _iconList is None :\n _iconList... |
'''
Created on 2009-08-30
@author: beaudoin
This file contains a class that can be used as a python interpreter console
'''
import wx
import sys
class PythonConsole(wx.Panel):
"""A console to output python and a command line interprete.
You should only have one of this as it seize the standard ... | [
[
8,
0,
0.0222,
0.0389,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.05,
0.0056,
0,
0.66,
0.3333,
666,
0,
1,
0,
0,
666,
0,
0
],
[
1,
0,
0.0556,
0.0056,
0,
0.66,
... | [
"'''\nCreated on 2009-08-30\n\n@author: beaudoin\n\nThis file contains a class that can be used as a python interpreter console\n'''",
"import wx",
"import sys",
"class PythonConsole(wx.Panel):\n \"\"\"A console to output python and a command line interprete.\n You should only have one of this as it sei... |
'''
Created on 2009-08-25
Basic controller editor
@author: beaudoin
'''
import sys
sys.path += ['.']
import wx, App, math
movieResolution = (1280,720)
movieSetup = False # True if we want a movie
glMovie = False # True if we're only interested in recording the GL canvas
# False ... | [
[
8,
0,
0.0408,
0.0714,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0816,
0.0102,
0,
0.66,
0.0345,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1122,
0.0102,
0,
0.66... | [
"'''\nCreated on 2009-08-25\n\nBasic controller editor\n\n@author: beaudoin\n'''",
"import sys",
"import wx, App, math",
"movieResolution = (1280,720)",
"movieSetup = False # True if we want a movie",
"glMovie = False # True if we're only interested in recording the GL canvas",
"glCanvasSize = wx.Def... |
'''
Created on 2009-08-28
@author: beaudoin
'''
from App.Proxys import *
data = RigidBody(
name = "ground",
locked = True,
cdps = [ BoxCDP( (-50,-1,-50), (50,0,50) ),
PlaneCDP( (0,1,0), (0,-1,0) ) ],
frictionCoeff = 2.5,
restitutionCoeff = 0.35 ) | [
[
8,
0,
0.2,
0.3333,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.4667,
0.0667,
0,
0.66,
0.5,
536,
0,
1,
0,
0,
536,
0,
0
],
[
14,
0,
0.8,
0.4667,
0,
0.66,
1,... | [
"'''\nCreated on 2009-08-28\n\n@author: beaudoin\n'''",
"from App.Proxys import *",
"data = RigidBody(\n name = \"ground\",\n locked = True,\n cdps = [ BoxCDP( (-50,-1,-50), (50,0,50) ),\n PlaneCDP( (0,1,0), (0,-1,0) ) ],\n frictionCoeff = 2.5,\n restitutionCoeff = 0.35 )"
] |
'''
Created on 2009-08-28
@author: beaudoin
'''
from App.Proxys import *
data = RigidBody(
name = "ground",
locked = True,
cdps = [ PlaneCDP( (0,1,0), (0,0,0) ) ],
frictionCoeff = 2.5,
restitutionCoeff = 0.35 )
| [
[
8,
0,
0.2143,
0.3571,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.5,
0.0714,
0,
0.66,
0.5,
536,
0,
1,
0,
0,
536,
0,
0
],
[
14,
0,
0.8214,
0.4286,
0,
0.66,
... | [
"'''\nCreated on 2009-08-28\n\n@author: beaudoin\n'''",
"from App.Proxys import *",
"data = RigidBody(\n name = \"ground\",\n locked = True,\n cdps = [ PlaneCDP( (0,1,0), (0,0,0) ) ],\n frictionCoeff = 2.5,\n restitutionCoeff = 0.35 )"
] |
'''
Created on 2009-08-28
@author: beaudoin
'''
from App.Proxys import *
data = RigidBody(
name = "dodgeBall",
meshes = [ ("../data/models/sphere.obj",(0.8,0,0,1)) ],
mass = 2.0,
moi = ( 0.2,0.2,0.2 ),
cdps = [ SphereCDP( (0,0,0), 0.1 ) ],
pos = (1000, 1000, 0.2),
frictionC... | [
[
8,
0,
0.1765,
0.2941,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.4118,
0.0588,
0,
0.66,
0.5,
536,
0,
1,
0,
0,
536,
0,
0
],
[
14,
0,
0.7647,
0.5294,
0,
0.66,
... | [
"'''\nCreated on 2009-08-28\n\n@author: beaudoin\n'''",
"from App.Proxys import *",
"data = RigidBody(\n name = \"dodgeBall\",\n meshes = [ (\"../data/models/sphere.obj\",(0.8,0,0,1)) ],\n mass = 2.0,\n moi = ( 0.2,0.2,0.2 ),\n cdps = [ SphereCDP( (0,0,0), 0.1 ) ],\n pos = (1000, 1000, 0.2),\n... |
'''
Created on 2009-08-28
@author: beaudoin
'''
from os import path
meshDir = path.join( path.dirname(__file__), "Meshes" )
colourDark = ( 0.5, 0.5, 0.5, 1 )
colourLight = ( 0.8, 0.8, 0.8, 1 )
from App.Proxys import *
data = Character(
name = "Bip",
... | [
[
8,
0,
0.0096,
0.0161,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0225,
0.0032,
0,
0.66,
0.1667,
688,
0,
1,
0,
0,
688,
0,
0
],
[
14,
0,
0.0289,
0.0032,
0,
0.6... | [
"'''\nCreated on 2009-08-28\n\n@author: beaudoin\n'''",
"from os import path",
"meshDir = path.join( path.dirname(__file__), \"Meshes\" )",
"colourDark = ( 0.5, 0.5, 0.5, 1 )",
"colourLight = ( 0.8, 0.8, 0.8, 1 )",
"from App.Proxys import *",
"data = Character(\n \n name = \"... |
from App.Proxys import *
data = SimBiController(
name = 'Turning',
controlParamsList = [
ControlParams( joint = 'root', kp = 3000.0, kd = 300.0, tauMax = 10000.0, scale = ( 1.0, 0.2, 1.0 ) ),
ControlParams( joint = 'pelvis_torso', kp = 200.0, kd = 30.0, tauMax = 10000.0, scale = ( 1... | [
[
1,
0,
0.0026,
0.0026,
0,
0.66,
0,
536,
0,
1,
0,
0,
536,
0,
0
],
[
14,
0,
0.5039,
0.9948,
0,
0.66,
1,
929,
3,
3,
0,
0,
597,
10,
90
]
] | [
"from App.Proxys import *",
"data = SimBiController( \n\n name = 'Turning',\n\n controlParamsList = [ \n ControlParams( joint = 'root', kp = 3000.0, kd = 300.0, tauMax = 10000.0, scale = ( 1.0, 0.2, 1.0 ) ),\n ControlParams( joint = 'pelvis_torso', kp = 200.0, kd = 30.0, tauMax = 10000.0, scal... |
from App.Proxys import *
data = SimBiController(
name = 'Jumping',
controlParamsList = [
ControlParams( joint = 'root', kp = 3000.0, kd = 300.0, tauMax = 10000.0, scale = ( 1.0, 0.2, 1.0 ) ),
ControlParams( joint = 'pelvis_torso', kp = 1000.0, kd = 100.0, tauMax = 10000.0, scale = (... | [
[
1,
0,
0.0024,
0.0024,
0,
0.66,
0,
536,
0,
1,
0,
0,
536,
0,
0
],
[
14,
0,
0.5036,
0.9952,
0,
0.66,
1,
929,
3,
3,
0,
0,
597,
10,
99
]
] | [
"from App.Proxys import *",
"data = SimBiController( \n\n name = 'Jumping',\n\n controlParamsList = [ \n ControlParams( joint = 'root', kp = 3000.0, kd = 300.0, tauMax = 10000.0, scale = ( 1.0, 0.2, 1.0 ) ),\n ControlParams( joint = 'pelvis_torso', kp = 1000.0, kd = 100.0, tauMax = 10000.0, sc... |
'''
Created on 2009-09-09
@author: beaudoin
'''
from App.Proxys import *
data = SimBiController(
name = 'Walking',
startingState = 0,
controlParamsList = [
ControlParams( joint = 'root', kp = 3000, kd = 300, tauMax = 10000, scale = ( 1, 0.2, 1 ) ),
ControlParams( join... | [
[
8,
0,
0.0146,
0.0244,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0341,
0.0049,
0,
0.66,
0.5,
536,
0,
1,
0,
0,
536,
0,
0
],
[
14,
0,
0.522,
0.961,
0,
0.66,
... | [
"'''\nCreated on 2009-09-09\n\n@author: beaudoin\n'''",
"from App.Proxys import *",
"data = SimBiController( \n\n name = 'Walking',\n\n startingState = 0,\n\n controlParamsList = [ \n ControlParams( joint = 'root', kp = 3000, kd = 300, tauMax = 10000, scale = ( 1, 0.2, 1 ) ),"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.