Skip to content

Commit

Permalink
Merge branch 'master' of github.com:oturing/ppqsp
Browse files Browse the repository at this point in the history
  • Loading branch information
ramalho committed Dec 31, 2011
2 parents 9e3d081 + e11d743 commit 4d501bb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion async/assincrono_clo.py
Expand Up @@ -27,7 +27,6 @@ def handle_request(response, index, nome):
if response.error:
print "Error:", response.error
else:
#nome = response.request.url[len(BASE_URL):]
print index+1, nome
with open(DESTINO+nome, 'wb') as img_local:
img_local.write(response.body)
Expand Down
2 changes: 1 addition & 1 deletion atributos/metaclasses/pedido8.py
Expand Up @@ -139,5 +139,5 @@ def __init__(self, descr, pr_unitario, qtd):
@classmethod
def listar_descritores(cls):
for atr in cls.list_ordered_descriptors():
print '%12s : %s' % (atr.attr_name, atr.__class__.__name__)
print '%12s : %s' % (atr.attr_name, type(atr).__name__)

3 changes: 2 additions & 1 deletion atributos/metaclasses/pedido9.py
Expand Up @@ -81,7 +81,8 @@ def validator(self, instance, value):
Parameters are the same for __set__: self, instance, value.
"""

def __set__(self, instance, value): # template method pattern
def __set__(self, instance, value):
# template method pattern: delegar validacao para subclasses
value = self.validator(instance, value)
setattr(instance, '__'+self.attr_name, value)

Expand Down

0 comments on commit 4d501bb

Please sign in to comment.