Club Atlético Peñarol | 45 | 30 | 1.8 goles por partido (en promedio) | 0.6 goles recibidos por partido (en promedio) | 75 puntos (en la tabla) | Segundo lugar (luchando por el liderato) | Rodrigo Abascal (lesión muscular) | Fase eliminatoria directa - Cuartos de final | https://www.peñarol.com/officialsite/peñarol/football/copa-uruguay.html | Peñarol ha ganado la Copa Uruguay cuatro veces en las últimas diez ediciones. | Peñarol fue subcampeón hace dos temporadas contra Nacional Montevideo. | Actualmente segundo lugar, pero muy cerca del líder Nacional Montevideo. | Se espera que ganen la fase eliminatoria directa si mantienen su rendimiento actual. | Peñarol se compara favorablemente contra Cerro Largo debido a su mejor defensa. | Usan una estrategia defensiva sólida combinada con contraataques rápidos. | Gran base de fanáticos tanto local como internacionalmente conocidos como "Aurinegros". Historia rica desde principios del siglo XX. |
Defensor Sporting | 40 | 35 | 1.6 goles por partido (en promedio) | 0.7 goles recibidos por partido (en promedio) | 70 puntos (en la tabla) | Tercer lugar (buscando mejorar) | Martín Ligüera (sanción disciplinaria) | Fase eliminatoria directa - Cuartos de final | https://www.defensor.org/officialsite/defensor-sporting/football/copa-uruguay.html | Defensor Sporting ha llegado a semifinales dos veces consecutivas antes. | Perdieron ante Peñarol en cuartos hace tres temporadas. | En tercer lugar, pero con potencial para escalar si ganan sus próximos partidos. | Esperan avanzar a las semifinales con un buen resultado frente a Peñarol. | Defensor tiene un ataque más fuerte pero podría ser vulnerable contra Peñarol.<|repo_name|>sorinov/guillotina<|file_sep|>/guillotina/__init__.py
from . import app_settings
from .security import NO_PERMISSION_REQUIRED
from .security import NO_USER_ID
from .security import set_security_policy
from .security import SecurityPolicy
__all__ = [
'NO_PERMISSION_REQUIRED',
'NO_USER_ID',
'SecurityPolicy',
]
set_security_policy(SecurityPolicy())
<|repo_name|>sorinov/guillotina<|file_sep|>/guillotina/reactive.py
import inspect
from collections import OrderedDict
from zope.interface import Interface
from zope.interface import implementer
from guillotina.component import get_utility
def _normalize_interface(interface):
if isinstance(interface, type) and issubclass(interface, Interface):
return interface
@implementer(Interface)
class IReactiveHandler:
pass
class ReactiveHandler(IReactiveHandler):
def __init__(self):
self._subscribers = OrderedDict()
self._interfaces = []
for interface in self._interfaces:
for obj in get_utility(
ISubscribers,
name=''.join(['_', interface.__name__])):
self.subscribe(obj)
for obj in get_utility(
ISubscribers,
name=''.join(['_', interface.__module__, '_', interface.__name__])):
self.subscribe(obj)
class ISubscribers(Interface):
@implementer(ISubscribers)
class Subscribers:
@implementer(ISubscribers)
class _ReactiveHandlerMeta(type):
def subscribe(self, subscriber):
def unsubscribe(self, subscriber):
def subscribe_to(self, interfaces):
def unsubscribe_from(self, interfaces):
def notify_subscribers(self, obj):
def notify_subscribers_by_interface(self, obj):
def subscribe_to_all_interfaces(self):
def unsubscribe_from_all_interfaces(self):
def get_subscribed_objects(self):
def get_subscribed_objects_by_interface(self):
def get_subscribed_interfaces(self):
def __getstate__(self):
def __setstate__(self, state):
def __iter__(self):
def __getitem__(self, interface):
ReactiveHandler.__metaclass__ = _ReactiveHandlerMeta
ReactiveHandler.subscribe = subscribe
ReactiveHandler.unsubscribe = unsubscribe
ReactiveHandler.subscribe_to = subscribe_to
ReactiveHandler.unsubscribe_from = unsubscribe_from
ReactiveHandler.notify_subscribers = notify_subscribers
ReactiveHandler.notify_subscribers_by_interface = notify_subscribers_by_interface
ReactiveHandler.subscribe_to_all_interfaces = subscribe_to_all_interfaces
ReactiveHandler.unsubscribe_from_all_interfaces = unsubscribe_from_all_interfaces
ReactiveHandler.get_subscribed_objects = get_subscribed_objects
ReactiveHandler.get_subscribed_objects_by_interface = get_subscribed_objects_by_interface
ReactiveHandler.get_subscribed_interfaces = get_subscribed_interfaces
ReactiveHandler.__getstate__ = __getstate__
ReactiveHandler.__setstate__ = __setstate__
ReactiveHandler.__iter__ = __iter__
ReactiveHandler.__getitem__ = __getitem__
<|file_sep|># -*- coding: utf-8 -*-
""" Guillotina traversal
This module implements the `IPathTraverser` adapter and the ``path`` utility.
"""
import re
from zope.interface import Interface
from guillotina.component import query_adapter
TRAILING_SLASH_PATTERN = re.compile(r'(/)+$')
class IPathTraverser(Interface):
""" An object that can be traversed by path segments.
A path traverser is responsible for taking an object and a path segment,
and returning an updated object.
This is the main contract used by the Guillotina traversal machinery.
It is the responsibility of this object to understand how to traverse to the next segment.
If it can't traverse to that segment it should raise `ValueError`.
It's also up to this object how to handle trailing slashes on paths.
The traverser should not modify the original object passed in during traversal.
If it needs to do some processing of its own it should make copies of the original object as needed.
The returned object should be able to be used again with this same traverser and another path segment.
Traversers are expected to be used on an instance by instance basis rather than globally.
This allows different types of objects to have different traversal semantics.
For example it makes sense that traversal over ``Container`` objects will be different than traversal over ``Folder`` objects.
The default Guillotina traverser expects the first path segment after the root to be an ID,
then subsequent segments can be either an ID or an attribute of the item returned by traversing the previous segment.
The following example shows how this works:
>>> from guillotina.traversal import traverse_path_with_root
>>> class MyItem(object):
... def __init__(self, id_):
... self.id = id_
... def __getitem__(self, key):
... if key == 'child':
... return MyItem('child')
...
>>> root_item = MyItem('root')
>>> path_traverser = IPathTraverser(root_item)
>>> result_item = traverse_path_with_root(path_traverser,
... '/child')
>>> result_item.id
'child'
>>> traverse_path_with_root(path_traverser,
... '/unknown')
Traceback (most recent call last):
...
ValueError: unknown
>>> traverse_path_with_root(path_traverser,
... '/child/something')
Traceback (most recent call last):
...
ValueError: something
>>> traverse_path_with_root(path_traverser,
...
|