コード例 #1
0
    def test_complete(self):
        tree = make_tree('positioning.rst')
        # Position the slides:
        position_slides(tree)

        # Get all slide position data:

        positions = []
        for step in tree.findall('step'):
            pos = {}
            for key in step.attrib:
                if key.startswith('data-'):
                    pos[key] = step.attrib[key]

            if 'hovercraft-path' in step.attrib:
                positions.append((step.attrib['hovercraft-path'], pos))
            else:
                positions.append(pos)

        self.assertEqual(positions, [
            {'data-x': '0', 'data-y': '0'},
             {'data-x': '1600', 'data-y': '0'},
             # Because of the path, we now get an explicit rotation:
             {'data-x': '3200', 'data-y': '0', 'data-rotate-z': '0'},
             {'data-x': '5600', 'data-y': '0', 'data-rotate-z': '44.99999999999999'},
             {'data-x': '5600', 'data-y': '2400', 'data-rotate-z': '90.0'},
             # Rotation carries over from last part of path.
             {'data-x': '0', 'data-y': '0', 'data-rotate-z': '90.0'},
             {'data-x': '-5600', 'data-y': '-2400', 'data-rotate-z': '90'},
             # The explicit rotate should continue here:
             {'data-x': '-11200', 'data-y': '-4800', 'data-rotate-z': '90'},
             # Path starts, rotation comes from path:
             {'data-x': '-16800', 'data-y': '-7200', 'data-rotate-z': '0'},
             {'data-x': '-14400', 'data-y': '-7200', 'data-rotate-z': '44.99999999999999'},
             # Explicit rotate-x and z, automatic position including rotate-z from path.
             {'data-x': '-14400', 'data-y': '-4800', 'data-rotate-z': '90.0', 'data-rotate-x': '180', 'data-z': '1000'},
             # Explicit x and y, all other carry over from last slide.
             {'data-x': '3000', 'data-y': '1000', 'data-rotate-z': '90.0', 'data-rotate-x': '180', 'data-z': '1000'},
        ])
コード例 #2
0
    def test_complete(self):
        tree = make_tree('positioning.rst')
        # Position the slides:
        position_slides(tree)

        # Get all slide position data:

        positions = []
        for step in tree.findall('step'):
            pos = {}
            for key in step.attrib:
                if key.startswith('data-'):
                    pos[key] = step.attrib[key]

            if 'hovercraft-path' in step.attrib:
                positions.append((step.attrib['hovercraft-path'], pos))
            else:
                positions.append(pos)

        self.assertEqual(
            positions,
            [
                {
                    'data-x': '0',
                    'data-y': '0'
                },
                {
                    'data-x': '1600',
                    'data-y': '0'
                },
                # Because of the path, we now get an explicit rotation:
                {
                    'data-x': '3200',
                    'data-y': '0',
                    'data-rotate-z': '0'
                },
                {
                    'data-x': '5600',
                    'data-y': '0',
                    'data-rotate-z': '44.99999999999999'
                },
                {
                    'data-x': '5600',
                    'data-y': '2400',
                    'data-rotate-z': '90.0'
                },
                # Rotation carries over from last part of path.
                {
                    'data-x': '0',
                    'data-y': '0',
                    'data-rotate-z': '90.0'
                },
                {
                    'data-x': '-5600',
                    'data-y': '-2400',
                    'data-rotate-z': '90'
                },
                # The explicit rotate should continue here:
                {
                    'data-x': '-11200',
                    'data-y': '-4800',
                    'data-rotate-z': '90'
                },
                # Path starts, rotation comes from path:
                {
                    'data-x': '-16800',
                    'data-y': '-7200',
                    'data-rotate-z': '0'
                },
                {
                    'data-x': '-14400',
                    'data-y': '-7200',
                    'data-rotate-z': '44.99999999999999'
                },
                # Explicit rotate-x and z, automatic position including rotate-z from path.
                {
                    'data-x': '-14400',
                    'data-y': '-4800',
                    'data-rotate-z': '90.0',
                    'data-rotate-x': '180',
                    'data-z': '1000'
                },
                # Explicit x and y, all other carry over from last slide.
                {
                    'data-x': '3000',
                    'data-y': '1000',
                    'data-rotate-z': '90.0',
                    'data-rotate-x': '180',
                    'data-z': '1000'
                },
            ])
コード例 #3
0
    def test_complete(self):
        tree = make_tree('positioning.rst')
        # Position the slides:
        position_slides(tree)

        # Get all slide position data:

        positions = []
        for step in tree.findall('step'):
            pos = {}
            for key in step.attrib:
                if key.startswith('data-'):
                    pos[key] = step.attrib[key]

            positions.append(pos)

        self.assertEqual(
            positions,
            [
                {
                    'data-x': '0',
                    'data-y': '0',
                    'data-z': '0',
                    'data-rotate-x': '0',
                    'data-rotate-y': '0',
                    'data-rotate-z': '0',
                    'data-scale': '1'
                },
                {
                    'data-x': '1600',
                    'data-y': '0',
                    'data-z': '0',
                    'data-rotate-x': '0',
                    'data-rotate-y': '0',
                    'data-rotate-z': '0',
                    'data-scale': '1'
                },
                # Because of the path, we now get an explicit rotation:
                {
                    'data-x': '3200',
                    'data-y': '0',
                    'data-z': '0',
                    'data-rotate-x': '0',
                    'data-rotate-y': '0',
                    'data-rotate-z': '0',
                    'data-scale': '1'
                },
                {
                    'data-x': '5600',
                    'data-y': '0',
                    'data-z': '0',
                    'data-rotate-x': '0',
                    'data-rotate-y': '0',
                    'data-rotate-z': '44.99999999999999',
                    'data-scale': '1'
                },
                {
                    'data-x': '5600',
                    'data-y': '2400',
                    'data-z': '0',
                    'data-rotate-x': '0',
                    'data-rotate-y': '0',
                    'data-rotate-z': '90.0',
                    'data-scale': '1'
                },
                # Rotation carries over from last part of path.
                {
                    'data-x': '0',
                    'data-y': '0',
                    'data-z': '0',
                    'data-rotate-x': '0',
                    'data-rotate-y': '0',
                    'data-rotate-z': '90.0',
                    'data-scale': '1'
                },
                # No position change
                {
                    'data-x': '0',
                    'data-y': '0',
                    'data-z': '0',
                    'data-rotate-x': '0',
                    'data-rotate-y': '0',
                    'data-rotate-z': '90',
                    'data-scale': '1'
                },
                # No change at all.
                {
                    'data-x': '0',
                    'data-y': '0',
                    'data-z': '0',
                    'data-rotate-x': '0',
                    'data-rotate-y': '0',
                    'data-rotate-z': '90',
                    'data-scale': '1'
                },
                # Path starts, rotation comes from path:
                {
                    'data-x': '0',
                    'data-y': '0',
                    'data-z': '0',
                    'data-rotate-x': '0',
                    'data-rotate-y': '0',
                    'data-rotate-z': '0',
                    'data-scale': '1'
                },
                {
                    'data-x': '2400',
                    'data-y': '0',
                    'data-z': '0',
                    'data-rotate-x': '0',
                    'data-rotate-y': '0',
                    'data-rotate-z': '44.99999999999999',
                    'data-scale': '1'
                },
                # Explicit rotate-x and z, automatic position including rotate-z from path.
                {
                    'data-x': '2400',
                    'data-y': '2400',
                    'data-z': '1000',
                    'data-rotate-x': '180',
                    'data-rotate-y': '0',
                    'data-rotate-z': '90.0',
                    'data-scale': '1'
                },
                # Explicit x and y, all other carry over from last slide.
                {
                    'data-x': '3000',
                    'data-y': '1000',
                    'data-z': '1000',
                    'data-rotate-x': '180',
                    'data-rotate-y': '0',
                    'data-rotate-z': '90.0',
                    'data-scale': '1'
                },
                # Positioning relative to other slide by id
                {
                    'data-x': '4000',
                    'data-y': '500',
                    'data-z': '1000',
                    'data-rotate-x': '180',
                    'data-rotate-y': '0',
                    'data-rotate-z': '90.0',
                    'data-scale': '1'
                },
                # Positioning x relative to other slide by id, Explicit y
                {
                    'data-x': '4800',
                    'data-y': '200',
                    'data-z': '1000',
                    'data-rotate-x': '180',
                    'data-rotate-y': '0',
                    'data-rotate-z': '90.0',
                    'data-scale': '1'
                },
            ])
コード例 #4
0
    def test_complete(self):
        tree = make_tree('positioning.rst')
        # Position the slides:
        position_slides(tree)

        # Get all slide position data:

        positions = []
        for step in tree.findall('step'):
            pos = {}
            for key in step.attrib:
                if key.startswith('data-'):
                    pos[key] = step.attrib[key]

            positions.append(pos)

        self.assertEqual(positions, [
            {'data-x': '0', 'data-y': '0', 'data-z': '0',
             'data-rotate-x': '0', 'data-rotate-y': '0',
             'data-rotate-z': '0', 'data-scale': '1'},
            {'data-x': '1600', 'data-y': '0', 'data-z': '0',
             'data-rotate-x': '0', 'data-rotate-y': '0',
             'data-rotate-z': '0', 'data-scale': '1'},
            # Because of the path, we now get an explicit rotation:
            {'data-x': '3200', 'data-y': '0', 'data-z': '0',
             'data-rotate-x': '0', 'data-rotate-y': '0',
             'data-rotate-z': '0', 'data-scale': '1'},
            {'data-x': '5600', 'data-y': '0', 'data-z': '0',
             'data-rotate-x': '0', 'data-rotate-y': '0',
             'data-rotate-z': '44.99999999999999', 'data-scale': '1'},
            {'data-x': '5600', 'data-y': '2400', 'data-z': '0',
             'data-rotate-x': '0', 'data-rotate-y': '0',
             'data-rotate-z': '90.0', 'data-scale': '1'},
            # Rotation carries over from last part of path.
            {'data-x': '0', 'data-y': '0', 'data-z': '0',
             'data-rotate-x': '0', 'data-rotate-y': '0',
             'data-rotate-z': '90.0', 'data-scale': '1'},
            # No position change
            {'data-x': '0', 'data-y': '0', 'data-z': '0',
             'data-rotate-x': '0', 'data-rotate-y': '0',
             'data-rotate-z': '90', 'data-scale': '1'},
            # No change at all.
            {'data-x': '0', 'data-y': '0', 'data-z': '0',
             'data-rotate-x': '0', 'data-rotate-y': '0',
             'data-rotate-z': '90', 'data-scale': '1'},
            # Path starts, rotation comes from path:
            {'data-x': '0', 'data-y': '0', 'data-z': '0',
             'data-rotate-x': '0', 'data-rotate-y': '0',
             'data-rotate-z': '0', 'data-scale': '1'},
            {'data-x': '2400', 'data-y': '0', 'data-z': '0',
             'data-rotate-x': '0', 'data-rotate-y': '0',
             'data-rotate-z': '44.99999999999999', 'data-scale': '1'},
            # Explicit rotate-x and z, automatic position including rotate-z from path.
            {'data-x': '2400', 'data-y': '2400', 'data-z': '1000',
             'data-rotate-x': '180', 'data-rotate-y': '0',
             'data-rotate-z': '90.0', 'data-scale': '1'},
            # Explicit x and y, all other carry over from last slide.
            {'data-x': '3000', 'data-y': '1000', 'data-z': '1000',
             'data-rotate-x': '180', 'data-rotate-y': '0',
             'data-rotate-z': '90.0', 'data-scale': '1'},
        ])
コード例 #5
0
    def test_complete(self):
        tree = make_tree("positioning.rst")
        # Position the slides:
        position_slides(tree)

        # Get all slide position data:

        positions = []
        for step in tree.findall("step"):
            pos = {}
            for key in step.attrib:
                if key.startswith("data-"):
                    pos[key] = step.attrib[key]

            positions.append(pos)

        self.assertEqual(
            positions,
            [
                {
                    "data-x": "0",
                    "data-y": "0",
                    "data-z": "0",
                    "data-rotate-x": "0",
                    "data-rotate-y": "0",
                    "data-rotate-z": "0",
                    "data-scale": "1",
                },
                {
                    "data-x": "1600",
                    "data-y": "0",
                    "data-z": "0",
                    "data-rotate-x": "0",
                    "data-rotate-y": "0",
                    "data-rotate-z": "0",
                    "data-scale": "1",
                },
                # Because of the path, we now get an explicit rotation:
                {
                    "data-x": "3200",
                    "data-y": "0",
                    "data-z": "0",
                    "data-rotate-x": "0",
                    "data-rotate-y": "0",
                    "data-rotate-z": "0",
                    "data-scale": "1",
                },
                {
                    "data-x": "5600",
                    "data-y": "0",
                    "data-z": "0",
                    "data-rotate-x": "0",
                    "data-rotate-y": "0",
                    "data-rotate-z": "44.99999999999999",
                    "data-scale": "1",
                },
                {
                    "data-x": "5600",
                    "data-y": "2400",
                    "data-z": "0",
                    "data-rotate-x": "0",
                    "data-rotate-y": "0",
                    "data-rotate-z": "90.0",
                    "data-scale": "1",
                },
                # Rotation carries over from last part of path.
                {
                    "data-x": "0",
                    "data-y": "0",
                    "data-z": "0",
                    "data-rotate-x": "0",
                    "data-rotate-y": "0",
                    "data-rotate-z": "90.0",
                    "data-scale": "1",
                },
                # No position change
                {
                    "data-x": "0",
                    "data-y": "0",
                    "data-z": "0",
                    "data-rotate-x": "0",
                    "data-rotate-y": "0",
                    "data-rotate-z": "90",
                    "data-scale": "1",
                },
                # No change at all.
                {
                    "data-x": "0",
                    "data-y": "0",
                    "data-z": "0",
                    "data-rotate-x": "0",
                    "data-rotate-y": "0",
                    "data-rotate-z": "90",
                    "data-scale": "1",
                },
                # Path starts, rotation comes from path:
                {
                    "data-x": "0",
                    "data-y": "0",
                    "data-z": "0",
                    "data-rotate-x": "0",
                    "data-rotate-y": "0",
                    "data-rotate-z": "0",
                    "data-scale": "1",
                },
                {
                    "data-x": "2400",
                    "data-y": "0",
                    "data-z": "0",
                    "data-rotate-x": "0",
                    "data-rotate-y": "0",
                    "data-rotate-z": "44.99999999999999",
                    "data-scale": "1",
                },
                # Explicit rotate-x and z, automatic position including rotate-z from path.
                {
                    "data-x": "2400",
                    "data-y": "2400",
                    "data-z": "1000",
                    "data-rotate-x": "180",
                    "data-rotate-y": "0",
                    "data-rotate-z": "90.0",
                    "data-scale": "1",
                },
                # Explicit x and y, all other carry over from last slide.
                {
                    "data-x": "3000",
                    "data-y": "1000",
                    "data-z": "1000",
                    "data-rotate-x": "180",
                    "data-rotate-y": "0",
                    "data-rotate-z": "90.0",
                    "data-scale": "1",
                },
                # Positioning relative to other slide by id
                {
                    "data-x": "4000",
                    "data-y": "500",
                    "data-z": "1000",
                    "data-rotate-x": "180",
                    "data-rotate-y": "0",
                    "data-rotate-z": "90.0",
                    "data-scale": "1",
                },
                # Positioning x relative to other slide by id, Explicit y
                {
                    "data-x": "4800",
                    "data-y": "200",
                    "data-z": "1000",
                    "data-rotate-x": "180",
                    "data-rotate-y": "0",
                    "data-rotate-z": "90.0",
                    "data-scale": "1",
                },
            ],
        )