This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gunicorn_paster --workers=2 development.ini | |
Traceback (most recent call last): | |
File "/Users/director/dev/pylons_envs/mydevenv/bin/gunicorn_paster", line 8, in <module> | |
load_entry_point('gunicorn==0.4', 'console_scripts', 'gunicorn_paster')() | |
File "/Users/director/dev/pylons_envs/mydevenv/lib/python2.6/site-packages/gunicorn/main.py", line 249, in run_paster | |
main(__usage__, get_app) | |
File "/Users/director/dev/pylons_envs/mydevenv/lib/python2.6/site-packages/gunicorn/main.py", line 92, in main | |
app = get_app(parser, opts, args) | |
File "/Users/director/dev/pylons_envs/mydevenv/lib/python2.6/site-packages/gunicorn/main.py", line 235, in get_app | |
host = opts.host or ctx.local_conf.get('host', '127.0.0.1') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File "prueba.py", line 3, in <module> | |
engine = sa.create_engine("mssql+pymssql://foo:bar@host/pruebas" ) | |
File "/home/smartics/myenv/lib/python2.6/site-packages/SQLAlchemy-0.6beta1-py2.6.egg/sqlalchemy/engine/__init__.py", line 223, in create_engine | |
return strategy.create(*args, **kwargs) | |
File "/home/smartics/myenv/lib/python2.6/site-packages/SQLAlchemy-0.6beta1-py2.6.egg/sqlalchemy/engine/strategies.py", line 57, in create | |
for k in util.get_func_kwargs(dialect_cls.dbapi): | |
AttributeError: type object 'MSDialect_pymssql' has no attribute 'dbapi' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File "prueba.py", line 3, in <module> | |
engine = sa.create_engine("mssql+pymssql://foo/bar@host/pruebas" ) | |
File "/home/smartics/myenv/src/sqlalchemy/lib/sqlalchemy/engine/__init__.py", line 223, in create_engine | |
return strategy.create(*args, **kwargs) | |
File "/home/smartics/myenv/src/sqlalchemy/lib/sqlalchemy/engine/strategies.py", line 65, in create | |
dialect = dialect_cls(**dialect_args) | |
File "/home/smartics/myenv/src/sqlalchemy/lib/sqlalchemy/dialects/mssql/pymssql.py", line 25, in __init__ | |
super(MSSQLDialect_pymssql, self).__init__(**params) | |
NameError: global name 'MSSQLDialect_pymssql' is not defined |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def logger(f, name=None): | |
# Closure to remember our name and function objects | |
if name is None: | |
name = f.func_name | |
def wrapped(*args, **kwargs): | |
#print "Calling", name, args, kwargs | |
log_queue.append((name, xdt.now().timetuple()[:6])) | |
result = f(*args, **kwargs) | |
#print "Called", name, args, kwargs, "returned", repr(result) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prnt("*Extra parameters") | |
def security_level(function, args, kwargs, level): | |
prnt("You are level", level) | |
if level == "admin": | |
return True | |
elif "override_security" in kwargs: | |
del kwargs['override_security'] | |
return True | |
else: | |
return False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@post("self.name and self.price >= 0 and Item.tax_rate >= 0", globals()) | |
def __init__(self, name, price): | |
self.name = name | |
self.price = price | |
def _invariant(self): | |
assert self.name not in ("Swiss", "Cheddar") | |
assert self.price > 0 | |
@pre("adjustment < 0") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#nada aun | |
class ToasterBox(object): | |
@classmethod | |
def play(cls, win, mensaje): | |
tb = TB.ToasterBox(win,TB.TB_SIMPLE,TB.DEFAULT_TB_STYLE, TB.TB_ONCLICK) | |
tb.SetPopupSize((250,200)) | |
tb.SetPopupPosition((500,500)) | |
tb.SetPopupPauseTime(4000) | |
tb.SetPopupScrollSpeed(8) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@expose() | |
def sns(self,*args, **kwargs): | |
try: | |
d = json.loads(request.body) | |
except: | |
d = dict() | |
d[u"Message"] = "Dummy Message" | |
m = d.get(u"Message", "").encode("utf-8") | |
t = Twitter() | |
t.setauth(TW_USER,TW_PWD) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
SKYPE_DESTINATION = "placeusernamehere_or_number_if_you_have_skype_credit" | |
with open("skype.html", "w") as f: | |
contents = """ | |
<html> | |
<head> | |
<script> | |
window.location="skype:{0}?call"; | |
</script> | |
</head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ano = wx.GetTextFromUser(u"Indique año","Reporte") | |
mes = wx.GetTextFromUser(u"Indique mes","Reporte") | |
foo, ultimo_dia = calendar.monthrange(int(ano),int(mes)) | |
REPORTE = "{2}{0:02d}{1}.txt".format(int(mes),ano,rfc) | |
with open(REPORTE,"w") as f: | |
for factura in model.session.query(model.Factura).filter( model.Factura.fecha.between(datetime(int(ano),int(mes),1), datetime(int(ano),int(mes),ultimo_dia,23,59,59))).all(): | |
subtotal = "{0:12.2f}".format(factura.subtotal).strip() | |
iva = "{0:12.2f}".format(factura.iva).strip() | |
f.write("|{0}||{1}|{2:4d}{3}|{4}|{5}|{6}|1|I||||\n".format(factura.mi_cliente.rfc, factura.folio, factura.ano_aprobacion, factura.aprobacion,factura.fecha_reporte, subtotal, iva )) | |
os.system("open {0}".format(REPORTE)) |