Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)
Allow access from ``domain``, which may be either a full
domain name, or a wildcard (e.g., ``*.example.com``, or simply
``*``). Due to security concerns, it is strongly recommended
that you use explicit domains rather than wildcards.

For socket policy files, pass a list of ports or port ranges
as the keyword argument ``to_ports``. As with ``domain``, a
wildcard value -- ``*`` -- will allow all ports.

To disable Flash's requirement of security matching (e.g.,(more...)

src/d/j/django-flashpolicies-1.5/flashpolicies/tests/policies.py   django-flashpolicies(Download)
        """
        policy = policies.Policy()
        policy.allow_domain('media.example.com')
        xml_dom = policy.xml_dom
        self.assertEqual(len(xml_dom.documentElement.childNodes), 1)
        policy = policies.Policy()
        ports = ['80', '8080', '9000-1000']
        policy.allow_domain('media.example.com', to_ports=ports)
        access_elem = policy.xml_dom.getElementsByTagName('allow-access-from')[0]
        self.assertEqual(len(access_elem.attributes), 2)
        """
        policy = policies.Policy()
        policy.allow_domain('media.example.com', secure=False)
        access_elem = policy.xml_dom.getElementsByTagName('allow-access-from')[0]
        self.assertEqual(len(access_elem.attributes), 2)

src/d/j/django-flashpolicies-1.5/flashpolicies/tests/urls.py   django-flashpolicies(Download)
def make_test_policy():
    policy = policies.Policy()
    policy.allow_domain('media.example.com')
    policy.allow_headers('media.example.com', ['SomeHeader'])
    return policy