コード例 #1
0
    def test_typedef(self):
        type_name = "TEST_String"
        type_id = AUID.from_list([0xb9da6c9e, 0x2b3c, 0x11d4, 0x8e, 0x50, 0x0, 0x90, 0x27, 0xdf, 0xcc, 0x26])

        prop_name = "STR Property Name"
        prop_id = AUID.from_list([0xb9da6c9f, 0x2b3c, 0x11d4, 0x8e, 0x50, 0x0, 0x90, 0x27, 0xdf, 0xcc, 0x26])
        f = aaf.open()

        string_typedef = aaf.define.TypeDefString(f, type_id, type_name)
        print(string_typedef)

        f.dictionary.register_def(string_typedef)

        mob_classdef = f.dictionary.lookup_classdef("Mob")

        mob_classdef.register_optional_propertydef(string_typedef, prop_id, prop_name)

        test_value = "Test Value"
        mob = f.create.MasterMob()
        mob[prop_name].value = test_value

        f.storage.add_mob(mob)

        self.assertEqual(mob[prop_name].value, test_value)
コード例 #2
0
ファイル: test_TypeDefRecord.py プロジェクト: cbenhagen/pyaaf
from aaf.util import AUID, MobID

import unittest
import os

cur_dir = os.path.dirname(os.path.abspath(__file__))

sandbox = os.path.join(cur_dir, 'sandbox')
if not os.path.exists(sandbox):
    os.makedirs(sandbox)

main_test_file = os.path.join(sandbox, 'test_TypeDef.aaf')

TypeId_Mixed = AUID.from_list([
    0xed9cbe2f, 0x1a42, 0x420c, 0x95, 0x2e, 0x7b, 0x23, 0xad, 0xbb, 0xc4, 0x79
])


class TypeDefRecord(unittest.TestCase):
    def test_basic(self):
        f = aaf.open(main_test_file, 'w')

        try:
            typdef = aaf.define.TypeDefRecord(f, [('some_int')], TypeId_Mixed,
                                              'MixedRecord')

        except ValueError:
            pass
            print(traceback.format_exc())
        else:
コード例 #3
0
from aaf.util import AUID, MobID

import unittest
import os

cur_dir = os.path.dirname(os.path.abspath(__file__))

sandbox = os.path.join(cur_dir,'sandbox')
if not os.path.exists(sandbox):
    os.makedirs(sandbox)

main_test_file = os.path.join(sandbox, 'test_TypeDefVariableArray.aaf')

# TypeDef IDs
TaggedValueStrongRefTypeID =  AUID.from_list([0xda60bb00, 0xba41, 0x11d4, 0xa8, 0x12, 0x8e, 0x54, 0x1b, 0x97, 0x2e, 0xa3 ])

# ValueVariableArray IDs
TEST_VA_TYPE_ID = AUID.from_list([0x47240c2e, 0x19d, 0x11d4, 0x8e, 0x3d, 0x0, 0x90, 0x27, 0xdf, 0xca, 0x7c])
TaggedValueVariableArrayTypeID =  AUID.from_list([0xc9fb1100, 0xba3e, 0x11d4, 0xa8, 0x12, 0x8e, 0x54, 0x1b, 0x97, 0x2e, 0xa3 ])
MobWeakRefVariableArrayTypeID = AUID.from_list([0xe9794b79, 0xab2f, 0x4827, 0x9a, 0x31, 0x35, 0x39, 0xb2, 0x98, 0x67, 0xd6])

# Property IDs
TEST_PROP_ID = AUID.from_list([ 0x47240c2f, 0x19d, 0x11d4, 0x8e, 0x3d, 0x0, 0x90, 0x27, 0xdf, 0xca, 0x7c ])
ComponentAttributesProperty1ID = AUID.from_list([0x198e0c80, 0xba40, 0x11d4, 0xa8, 0x12, 0x8e, 0x54, 0x1b, 0x97, 0x2e, 0xa3])
ComponentAttributesProperty2ID = AUID.from_list([0x198e0c81, 0xba40, 0x11d4,  0xa8, 0x12, 0x8e, 0x54, 0x1b, 0x97, 0x2e, 0xa3])
MobReferencedMobsPropertyID = AUID.from_list([0x6f7b3c85, 0x7f57, 0x490b, 0xa3, 0xa8, 0xe5, 0xf2, 0xb4, 0xb1, 0x44, 0x34])

TEST_MobID = MobID.from_list([0x06, 0x0c, 0x2b, 0x34, 0x02, 0x05, 0x11, 0x01, 0x01, 0x00, 0x10, 0x00, 0x13,
                               0x00, 0x00, 0x00, 0xda, 0x5a, 0xb5, 0xf4, 0x04, 0x05, 0x11, 0xd4, 0x8e, 0x3d, 0x00, 0x90, 0x27, 0xdf, 0xca, 0x7c])
コード例 #4
0
import traceback

from aaf.util import AUID, MobID

import unittest
import os

cur_dir = os.path.dirname(os.path.abspath(__file__))

sandbox = os.path.join(cur_dir,'sandbox')
if not os.path.exists(sandbox):
    os.makedirs(sandbox)

main_test_file = os.path.join(sandbox, 'test_TypeDef.aaf')

TypeId_Mixed = AUID.from_list([0xed9cbe2f, 0x1a42, 0x420c, 0x95, 0x2e, 0x7b, 0x23, 0xad, 0xbb, 0xc4, 0x79 ])

class TypeDefRecord(unittest.TestCase):
    def test_basic(self):
        f = aaf.open(main_test_file, 'w')

        try:
            typdef = aaf.define.TypeDefRecord(f, [('some_int')], TypeId_Mixed, 'MixedRecord')

        except ValueError:
            pass
            print(traceback.format_exc())
        else:
            raise

        auid_typedef = f.dictionary.lookup_typedef("AUID")
コード例 #5
0
from aaf.util import AUID, MobID

import unittest
import os

cur_dir = os.path.dirname(os.path.abspath(__file__))

sandbox = os.path.join(cur_dir, 'sandbox')
if not os.path.exists(sandbox):
    os.makedirs(sandbox)

main_test_file = os.path.join(sandbox, 'test_TypeDefVariableArray.aaf')

# TypeDef IDs
TaggedValueStrongRefTypeID = AUID.from_list([
    0xda60bb00, 0xba41, 0x11d4, 0xa8, 0x12, 0x8e, 0x54, 0x1b, 0x97, 0x2e, 0xa3
])

# ValueVariableArray IDs
TEST_VA_TYPE_ID = AUID.from_list(
    [0x47240c2e, 0x19d, 0x11d4, 0x8e, 0x3d, 0x0, 0x90, 0x27, 0xdf, 0xca, 0x7c])
TaggedValueVariableArrayTypeID = AUID.from_list([
    0xc9fb1100, 0xba3e, 0x11d4, 0xa8, 0x12, 0x8e, 0x54, 0x1b, 0x97, 0x2e, 0xa3
])
MobWeakRefVariableArrayTypeID = AUID.from_list([
    0xe9794b79, 0xab2f, 0x4827, 0x9a, 0x31, 0x35, 0x39, 0xb2, 0x98, 0x67, 0xd6
])

# Property IDs
TEST_PROP_ID = AUID.from_list(
    [0x47240c2f, 0x19d, 0x11d4, 0x8e, 0x3d, 0x0, 0x90, 0x27, 0xdf, 0xca, 0x7c])