labs. bfloch.com/script/
private.  
/script /output
/links
/about



 »    
10/Aug/20
python

 
» Python Factory

Found this at http://ubuntuforums.org/showthread.php?t=749534

Code:

import sys
 
class FooBase(object):
    def __new__(cls, url, *arguments, **keyword):
        for subclass in FooBase.__subclasses__():
            if url.startswith(subclass.prefix):
                return super(cls, subclass).__new__(subclass, *arguments, **keyword)
        raise Exception, 'Prefix not supported'
 
class HttpFoo(FooBase):
    prefix = 'http'
 
class FtpFoo(FooBase):
    prefix = 'ftp'
 
if __name__ == '__main__':
    foo = FooBase('http://abc.com')
    print foo.prefix
 
    foo = FooBase('ftp://abc.com')
    print foo.prefix
 
    try:
        foo = FooBase('ssh://abc.com')
    except Exception, message:
        print message
..................................................

10/Jan/22
general, news

 
» Fresh recipes
..................................................

09/Nov/16
application

 
» Disable Tablet pen poop
..................................................

09/Oct/26
fusion, script, release

 
» bf_rename Version 3.1
..................................................

09/Jul/06
batch

 
» Shell file splitting
..................................................

09/Jun/07
check this out, technology

 
» CineForm and 3D
..................................................

09/Jun/02
check this out, technology, games

 
» Peter does it again
..................................................

09/Jun/02
fusion, script, beta, python, lua

 
» SVGet Beta
..................................................

09/May/30
fusion, script, status, python

 
» SVGet an almost there
..................................................

09/May/27
maya, plugin

 
» decomposeMatrix
..................................................

09/May/24
fusion, script, status

 
» SVGet there soon
..................................................

09/May/23
check this out

 
» Editors talk Avid, Apple, Adobe
..................................................

  page »