def get_echoarea(name, raw=False): if not flt.echo_flt(name): return '' if raw else [] try: txt = open('echo/%s' % name).read() return txt if raw else txt.splitlines() except: return '' if raw else []
def get_echoarea(name,raw=False): if not flt.echo_flt(name): return '' if raw else [] try: txt = open('echo/%s' % name).read() return txt if raw else txt.splitlines() except: return '' if raw else []
def mkmsg(obj, rh=None): if not flt.echo_flt(obj.echoarea): return if rh and not flt.msg_flt(rh): return s = _out(obj).encode('utf-8') h = rh or sx.hsh(s) if len(s) < 65536: open('msg/%s' % h, 'wb').write(s) open('echo/%s' % obj.echoarea, 'ab').write(h + '\n') return h
def mkmsg(obj,rh=None): if not flt.echo_flt(obj.echoarea): return if rh and not flt.msg_flt(rh): return s = _out(obj).encode('utf-8') h = rh or sx.hsh(s) if len(s) < 65536: open('msg/%s' % h,'wb').write(s) open('echo/%s' % obj.echoarea,'ab').write(h + '\n') return h
def toss(msgfrom, addr, tmsg): lines = b64d(tmsg).decode('utf-8').splitlines() if flt.echo_flt(lines[0]): mo = sx.mydict(date=sx.gts(), msgfrom=msgfrom, addr=addr, echoarea=lines[0], msgto=lines[1], subj=lines[2], msg='\n'.join(lines[4:])) return mo
def toss(msgfrom,addr,tmsg): lines = b64d(tmsg).decode('utf-8').splitlines() if flt.echo_flt(lines[0]): mo = sx.mydict(date=sx.gts(),msgfrom=msgfrom,addr=addr,echoarea=lines[0],msgto=lines[1],subj=lines[2],msg='\n'.join(lines[4:])) return mo