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 preview(event): | |
| prt = PrintTable() | |
| regs = [] | |
| for anotacion in model.session.query( model.Anotacion ).filter( model.Anotacion.relacion == self.data).order_by( model.Anotacion.fecha_elaboracion.desc()): | |
| regs.append([ anotacion.fecha_local, unicode( anotacion.anotacion )]) | |
| prt.data = regs | |
| prt.left_margin = 0.5 | |
| prt.set_column = [2.0, 5.0] | |
| prt.label = ["Fecha",u"Anotación"] | |
| Tabla = getattr(model, anotacion.fuente) |
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 email(to, subject, body, filenames = []): | |
| try: | |
| usuario, password = get_google_account() | |
| source = usuario | |
| if "@" in usuario: | |
| #if usuario.split("@")[-1] == "gmail.com": | |
| #usuario = usuario.split("@")[:-1] | |
| pass | |
| 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
| class IniDialog(BaseDialog): | |
| def AddControls(self): | |
| lbox = gizmos.EditableListBox( self.pane, -1, u"Edición de INI", (100,100), (250,250)) | |
| with open("felec.ini") as f: | |
| lineas = [ linea for linea in f.read().split("\n") if linea ] | |
| lbox.SetStrings( lineas ) |
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 anotaciones(self): | |
| lc = self.lc | |
| lc.ClearAll() | |
| bg1 = wx.Colour(239,235,239) | |
| bg2 = wx.Colour(255,207,99) | |
| title = u"#,Fecha, Anotación" | |
| for i, colTitle in enumerate(title.split(",")): | |
| lc.InsertColumn(i,colTitle) | |
| x = 0 | |
| for anotacion in model.session.query( model.Anotacion ).filter( model.Anotacion.relacion == self.data).order_by( model.Anotacion.fecha_elaboracion.desc()): |
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
| if c[1] == "fecha_iso": | |
| wx.StaticText(self.pane,-1,"") | |
| f_button = GB.GradientButton(self.pane,-1,None,"Editar Fecha Especial") | |
| self.f_iso = text | |
| wx.StaticText(self.pane,-1,"Porcentajes") | |
| porc_button = GB.GradientButton(self.pane,-1,None,"Cambiar") | |
| wx.StaticText(self.pane,-1,"Partidas") | |
| subpane = sc.SizedPanel(self.pane,-1) | |
| subpane.SetSizerType("horizontal") |
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 wx.lib.agw.gradientbutton as GB | |
| import wx.lib.agw.genericmessagedialog as GMD | |
| class GMDialog(object): | |
| @classmethod | |
| def show(cls, win, mensaje, titulo): | |
| dlg = GMD.GenericMessageDialog(win, mensaje, titulo, wx.OK | ( wx.ICON_INFORMATION + GMD.GMD_USE_GRADIENTBUTTONS ) ) | |
| val = dlg.ShowModal() | |
| dlg.Destroy() | |
| return val |
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
| class Factura(Base): | |
| __tablename__ = "facturas" | |
| id = Column( Integer, primary_key = True ) | |
| folio = Column( Integer, unique = True ) | |
| fecha = Column( DateTime ) | |
| aprobacion = Column( Integer ) | |
| ano_aprobacion = Column( Integer ) | |
| certificado = Column(String(20)) | |
| cliente = Column( Integer , ForeignKey( "clientes.id")) | |
| porcentaje_iva = Column( Numeric(6,3)) |
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 sys, boto | |
| from hashlib import md5 | |
| try: | |
| bucket, key_name, local_name = sys.argv[1:] | |
| except: | |
| sys.exit("wrong arguments") | |
| c = boto.connect_s3() | |
| b = c.get_bucket(bucket, validate = 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
| import boto, sys | |
| c = boto.connect_s3() | |
| b = c.get_bucket(sys.argv[1], validate = False) | |
| for key in b.get_all_keys(): | |
| print key.name, key.etag |
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
| # works with python 2.7 | |
| import boto, sys, json | |
| c = boto.connect_iam() | |
| user = sys.argv[1] | |
| policy_name = "list_all_buckets_{}".format( user ) | |
| policy = json.dumps(dict( Statement = [ dict(Effect = "Allow", Action = "s3:ListAllMyBuckets" , Resource = "arn:aws:s3:::*"),])) |