code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
from zope.interface import Interface
class IConversationView(Interface):
def comments():
"""Return all comments in the conversation.
"""
def conversation():
"""Return active conversation.
"""
def root_comments():
"""Return all of the root comments for a conversatio... | Python |
from Products import Five
from Products.CMFCore.utils import getToolByName
from Products.Ploneboard.browser.utils import toPloneboardTime, getNumberOfConversations
from Products.Ploneboard.interfaces import IForum, IComment
class BoardView(Five.BrowserView):
"""View methods for board type
"""
def __init__... | Python |
#
| Python |
"""
$Id: comment.py 99041 2009-10-06 06:38:21Z sureshvv $
"""
from zope import interface
from Acquisition import aq_base
from DateTime.DateTime import DateTime
from Products import Five
from Products.CMFCore import utils as cmf_utils
from Products.CMFCore.utils import getToolByName
from Products.Ploneboard import permi... | Python |
from zope.interface import implements
from zope import schema
from zope.component import getUtility
from zope.component import getMultiAdapter
from zope.formlib.form import Fields
from plone.memoize.view import memoize
from Products.CMFCore.utils import getToolByName
from Products.Five.browser.pagetemplatefile import V... | Python |
# Poof
| Python |
from zope.interface import implements
from AccessControl import ClassSecurityInfo
from Acquisition import aq_inner, aq_chain
from DateTime import DateTime
from OFS.Image import File
from Products.CMFCore.utils import getToolByName
from Products.Archetypes.public import BaseBTreeFolderSchema, Schema, TextField, Refere... | Python |
from zope.interface import implements
from AccessControl import ClassSecurityInfo
from Acquisition import aq_inner, aq_chain
from OFS.CopySupport import _cb_decode, _cb_encode, CopyContainer, CopyError
from OFS.Image import File
from OFS.Moniker import Moniker
from Products.CMFCore.utils import getToolByName
from Pr... | Python |
from zope.interface import implements
from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import getToolByName
from Products.Archetypes.public import BaseBTreeFolderSchema, Schema, TextField, LinesField
from Products.Archetypes.public import BaseBTreeFolder, registerType
from Products.Archetypes.p... | Python |
from zope.interface import implements
from AccessControl import ClassSecurityInfo
from Acquisition import aq_chain, aq_inner
from OFS.CopySupport import CopyContainer
from OFS.Image import File
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.utils import _createObjectByType, log_deprecated
fr... | Python |
import Ploneboard
import PloneboardForum
import PloneboardConversation
import PloneboardComment
| Python |
try:
from lipsum import markupgenerator
except ImportError:
class markupgenerator(object):
def __init__(self,sample,dictionary):pass
def generate_sentence(self):return 'subject'
def generate_paragraph(self):return 'Please install lorem-ipsum-generator.'
import transaction
from time impo... | Python |
"""
$Id: interfaces.py 55766 2007-12-18 11:08:52Z wichert $
"""
# Dependency on Zope 2.8.x (or greater) or Five
from zope.interface import Interface, Attribute
class IPloneboard(Interface):
"""
Ploneboard is the outmost board object, what shows up in your site.
The board contains forums. Board is folderish... | Python |
"""
$Id: PloneboardTool.py 58018 2008-02-01 16:30:48Z wichert $
"""
import Globals
from AccessControl import ClassSecurityInfo
from OFS.Image import File
from OFS.Folder import Folder
from ZPublisher.HTTPRequest import FileUpload
from ZODB.PersistentMapping import PersistentMapping
from zope.interface import implement... | Python |
from Products.Ploneboard.interfaces import IConversation
from plone.indexer.decorator import indexer
@indexer(IConversation)
def num_comments(obj):
return obj.getNumberOfComments()
| Python |
from Testing import ZopeTestCase
# Make the boring stuff load quietly
ZopeTestCase.installProduct('SimpleAttachment')
ZopeTestCase.installProduct('CMFPlacefulWorkflow')
ZopeTestCase.installProduct('Ploneboard')
from Products.PloneTestCase import PloneTestCase
PloneTestCase.setupPloneSite(products=('SimpleAttachment'... | Python |
import Products.Five
import Products.ATContentTypes
from Products.CMFPlacefulWorkflow.WorkflowPolicyConfig import manage_addWorkflowPolicyConfig
from DateTime import DateTime
def addMember(self, username, fullname="", email="", roles=('Member',), last_login_time=None):
self.portal.portal_membership.addMember(user... | Python |
#
# Conversation tests
#
import transaction
import unittest
from zope.interface.verify import verifyClass, verifyObject
import PloneboardTestCase
from Products.CMFPlone.utils import _createObjectByType
from Products.Ploneboard.interfaces import IConversation
from Products.Ploneboard.content.PloneboardConversation imp... | Python |
#
# Ploneboard tests
#
from Products.Ploneboard.tests import PloneboardTestCase
# Catch errors in Install
from Products.Ploneboard.Extensions import Install
from Products.CMFCore.utils import getToolByName
class TestSetup(PloneboardTestCase.PloneboardTestCase):
def testSkins(self):
portal_skins = self.... | Python |
"""Ploneboard functional doctests. This module collects all *.txt
files in the tests directory and runs them. (stolen from Plone)
"""
import os, sys
import glob
import doctest
import unittest
from Globals import package_home
from Testing.ZopeTestCase import FunctionalDocFileSuite as Suite
from Products.Ploneboard.c... | Python |
#
# Comment tests
#
import unittest
from zope.interface.verify import verifyClass
import PloneboardTestCase
from Products.Ploneboard.interfaces import IComment
from Products.Ploneboard.content.PloneboardComment import PloneboardComment
from Products.Ploneboard.config import HAS_SIMPLEATTACHMENT
from OFS.Image import... | Python |
#
# Comment tests
#
import unittest
from Products.Ploneboard.tests import PloneboardTestCase
from Products.CMFPlone.utils import _createObjectByType
class TestITextContentAdapter(PloneboardTestCase.PloneboardTestCase):
def afterSetUp(self):
from Products.ATContentTypes.interface import ITextContent
... | Python |
#
# Ploneboard tests
#
import unittest
from Products.Ploneboard.tests import PloneboardTestCase
from Products.Ploneboard.batch import Batch
from Products.CMFPlone.utils import _createObjectByType
class TestBatch(PloneboardTestCase.PloneboardTestCase):
def afterSetUp(self):
self.board = _createObjectBy... | Python |
#
# Tests the default workflow
#
from AccessControl.Permission import Permission
from Products.CMFPlone.tests import PloneTestCase
from Products.CMFCore.utils import _checkPermission as checkPerm
from Products.CMFPlone.utils import _createObjectByType
from Products.Ploneboard.Extensions import WorkflowScripts # Catc... | Python |
#
# Event notification tests
#
import unittest
import zope.component
from Products.Ploneboard.tests import PloneboardTestCase
from Products.Archetypes.event import ObjectInitializedEvent
from Products.CMFPlone.utils import _createObjectByType
notified = []
@zope.component.adapter(ObjectInitializedEvent)
def dummy... | Python |
#
# Ploneboard transform tests
#
import unittest
from Products.Ploneboard.tests import PloneboardTestCase
from Products.CMFCore.utils import getToolByName
from Products.Ploneboard.config import PLONEBOARD_TOOL
from Products.CMFPlone.utils import _createObjectByType
class TestTransformRegistration(PloneboardTestCase... | Python |
"""Ploneboard tests package
"""
| Python |
#
# Forum tests
#
import unittest
from zExceptions import Unauthorized
from zope.interface.verify import verifyClass, verifyObject
import PloneboardTestCase
from Products.Ploneboard.interfaces import IForum
from Products.Ploneboard.content.PloneboardForum import PloneboardForum
from Products.CMFCore.utils import get... | Python |
#
# 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):
... | Python |
#
# 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... | Python |
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... | Python |
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... | Python |
"""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... | Python |
"""
$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... | Python |
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... | Python |
"""
$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... | Python |
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/... | Python |
##############################################################################
#
# 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... | Python |
#coding=utf8
__author__ = 'alex'
import sys
import os
import uuid
import logging
from flask import Flask, g, session
import settings
from admin import admin
from index import index
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
from flask.ext.script import Manager
import bi... | Python |
#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 ... | Python |
#coding=utf8
__author__ = 'alex'
import logging
from flask import g
from models import *
class BizException(BaseException):
pass
def init_site_data():
def do_or_fail(obj):
try:
g.db.add(obj)
g.db.flush()
g.db.commit()
logging.info("object added")
... | Python |
#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!" | Python |
#coding=utf8
__author__ = 'alex'
from flask import g, jsonify, request, flash, url_for
from flask_mail import Message
import os
import settings
import time
import random
import json
import hmac
import redis
from pyDes import *
import sys, traceback
import urllib
from uuid import uuid4
def execute(query, page_idx, page... | Python |
#coding=utf8
__author__ = 'alex'
import logging
from flask import Blueprint, render_template, abort, g, request, redirect, url_for, session, flash
from models import *
from biz import *
from utils import *
admin = Blueprint('admin', __name__,template_folder='templates',url_prefix='/admin')
@admin.route("/login")
def ... | Python |
#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... | Python |
#!/usr/bin/python2.6
#
# Simple http server to emulate api.playfoursquare.com
import logging
import shutil
import sys
import urlparse
import SimpleHTTPServer
import BaseHTTPServer
class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""Handle playfoursquare.com requests, for testing."""
def do_GET(self... | Python |
#!/usr/bin/python
import os
import subprocess
import sys
BASEDIR = '../main/src/com/joelapenna/foursquare'
TYPESDIR = '../captures/types/v1'
captures = sys.argv[1:]
if not captures:
captures = os.listdir(TYPESDIR)
for f in captures:
basename = f.split('.')[0]
javaname = ''.join([c.capitalize() for c in basena... | Python |
#!/usr/bin/python
"""
Pull a oAuth protected page from foursquare.
Expects ~/.oget to contain (one on each line):
CONSUMER_KEY
CONSUMER_KEY_SECRET
USERNAME
PASSWORD
Don't forget to chmod 600 the file!
"""
import httplib
import os
import re
import sys
import urllib
import urllib2
import urlparse
import user
from xml.... | Python |
#!/usr/bin/python
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
PARSER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.parsers;
import com.joelapenna.foursquare.Foursquare;
import com.joelapenna.foursquare.error.FoursquareError;
import com.joel... | Python |
#!/usr/bin/python
import logging
from xml.dom import minidom
from xml.dom import pulldom
BOOLEAN = "boolean"
STRING = "String"
GROUP = "Group"
# Interfaces that all FoursquareTypes implement.
DEFAULT_INTERFACES = ['FoursquareType']
# Interfaces that specific FoursqureTypes implement.
INTERFACES = {
}
DEFAULT_CLA... | Python |
# 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, ... | Python |
# 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... | Python |
"""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... | 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 |
#!/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 ... | Python |
# Re-puts entities of a given type, to set newly added properties.
#
# 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.
# - Import models from coderevie... | Python |
#!/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 ... | Python |
#!/usr/bin/env python
import os
import sys
from optparse import HelpFormatter
sys.path.append(os.path.abspath('static/'))
import upload
class GCWikiHelpFormatter (HelpFormatter):
"""Format help with wiki markup for Google Code."""
def __init__(self,
indent_increment=2,
ma... | Python |
# 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... | Python |
# 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, ... | Python |
# 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, ... | Python |
# 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, ... | Python |
# 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, ... | Python |
# 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, ... | Python |
# 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, ... | Python |
# 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, ... | Python |
# 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, ... | Python |
# 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, ... | Python |
# 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, ... | Python |
#!/usr/bin/env python
#
# Copyright 2007 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 |
import BasicEditor | Python |
'''
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"],
}
}
) | Python |
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()
| Python |
import Utils
Utils.test() | Python |
'''
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... | Python |
'''
Created on 2009-08-26
@author: beaudoin
'''
from OpenGL.GL import *
from OpenGL.GLU import *
import PyUtils, wx, Physics, Utils, time, math, sys, Core
from ObservableList import ObservableList
from Curve import Curve
from SnapshotTree import SnapshotBranch
from MathLib import Vector3d, Point3d
def... | Python |
'''
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__()
... | Python |
'''
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... | Python |
'''
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."""
... | Python |
'''
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... | Python |
'''
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... | Python |
from Model import Model
from CharacterDescription import CharacterDescription
from CharacterScaler import CharacterScalerFront
from ToolSet import ToolSet | Python |
'''
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... | Python |
'''
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... | Python |
'''
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... | Python |
'''
Created on 2009-09-02
@author: beaudoin
'''
import Physics
import Proxy, Member
import PyUtils
import Physics
def addMesh( rb, mesh ):
"""Adds a single mesh which can be either:
- A single string (mesh filename)
- A tuple or list with a single string (mesh filename)
- A... | Python |
'''
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... | Python |
'''
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... | Python |
'''
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)
... | Python |
'''
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... | Python |
'''
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... | Python |
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... | Python |
'''
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... | Python |
from SNMApp import SNMApp
from SnapshotTree import SnapshotBranch, Snapshot
from ObservableList import ObservableList
import Scenario
import InstantChar
import KeyframeEditor | Python |
'''
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 = ... | Python |
'''
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... | Python |
from Staircase import Staircase | Python |
'''
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... | Python |
'''
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... | Python |
'''
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 ... | Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.