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

All Samples(15)  |  Call(15)  |  Derive(0)  |  Import(0)
Wrapper object for creating and manipulating a Flash cross-domain
policy.

In the simplest case -- specifying one or more domains to allow
access from -- simply pass the domains to the constructor. For
example::

    my_policy = Policy('media.example.com', 'api.example.com')

The property ``xml_dom`` of the returned ``Policy`` object will be(more...)

src/d/j/django-flashpolicies-1.5/flashpolicies/views.py   django-flashpolicies(Download)
 
    """
    return serve(request, policies.Policy(*domains))
 
 
    if domains is None:
        domains = []
    policy = policies.Policy(*domains)
    policy.metapolicy(permitted)
    return serve(request, policy)

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
 
        """
        policy = policies.Policy()
        ports = ['80', '8080', '9000-1000']
        policy.allow_domain('media.example.com', to_ports=ports)
 
        """
        policy = policies.Policy()
        policy.allow_domain('media.example.com', secure=False)
        access_elem = policy.xml_dom.getElementsByTagName('allow-access-from')[0]
        """
        for permitted in policies.VALID_SITE_CONTROL:
            policy = policies.Policy()
            policy.metapolicy(permitted)
            xml_dom = policy.xml_dom
 
        """
        policy = policies.Policy()
        self.assertRaises(TypeError, policy.metapolicy, 'not-valid')
 

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