This is a chunk of what its starting to look like now, thanks from colors import _available_colors as _ck from has_colors import _has_colors as _ha from log import _brush as _er
class stdout_colors(object): def __init__(self,colors_active=1,output_caller=1,caller_color="red",default=1, show_lineno_write=1,show_lineno_caller=1,break_all=1, logging=1,log_type="INFO",depth=10): self.caller_color = caller_color #stdout_colors function caller called output color self.output_caller = output_caller # output caller and called function self.colors_active = colors_active #active colors for output self.colors = _ck().colors crack=_er(colors_active,default,show_lineno_write,show_lineno_caller, break_all,logging,log_type,depth) #Thanks Gabriel Genellina, no crack was smoked during the making #list( ( self.__setattr__(x.replace("b_",""),getattr(B,x)) for x in dir(B) if x.startswith("b_") ) ) for smoke in dir(crack): if smoke.startswith("b_"): setattr(self, smoke[2:], getattr(crack, smoke)) -Alex Goretoy http://www.goretoy.com On Sat, Mar 14, 2009 at 3:13 AM, alex goretoy <aleksandr.gore...@gmail.com>wrote: > I can show you people more code if you want :) I like to learn > -Alex Goretoy > http://www.goretoy.com > > > > On Sat, Mar 14, 2009 at 3:09 AM, alex goretoy <aleksandr.gore...@gmail.com > > wrote: > >> I'm actually still getting to this section of my code, I've been working a >> logging,stdout colors lately, Although I am going to need __import__ in >> several places in this program >> >> -Alex Goretoy >> http://www.goretoy.com >> >> >> >> On Sat, Mar 14, 2009 at 3:05 AM, alex goretoy < >> aleksandr.gore...@gmail.com> wrote: >> >>> I don't get *why* someone would like to write that. Does it look "cool"? >>>> Is it some kind of "Look, ma, I know those hidden names!" syndrome? Is it >>>> contagious? >>>> >>> >>> I think thats what it is. It does look cool, thats for telling me about >>> the fact that >>> >>> prevents the interpreter from doing many optimizations... >>>> >>> that makes sense to me, where would I read more about python >>> optimizations? >>> I want to see code more, I like code, comments are good too :) >>> >>> I have this piece of code I would like to turn into a generator, can some >>> one please help me do it? >>> I want to make it very optimized. The data comes from a options file that >>> is parsed and used for this header/field function mapping function . I need >>> to generate this, unless you advise against it then what are my options? How >>> to wrap my head around this? >>> >>> >>> def loop_lines(self): >>> self.soc.me_him(['ENTER:',__name__],self.func_me_color) >>> print self.lines >>> for k in range(len(self.lines)): #for every line in csv file >>> self.line=self.lines[k] >>> for optv in self.order: >>> for optvv in self._optv[optv]["headers"]: >>> if self._optv[optv]["headers"][optvv]!="": >>> >>> _optvk=string.split(self._optv[optv]["headers"][optvv],",") >>> for optvk in _optvk: >>> for optvvv in self._optv[optv]["mappings"]: >>> if optvk == optvvv: >>> if >>> self._optv[optv]["mappings"][optvvv].find("self.fun.func") >= 0: >>> self.field=optvvv >>> >>> self.value=self.parsed[k][optvv].replace('"', '\\"').replace("'", "\\'") >>> >>> try: >>> exec >>> (self._optv[optv]["mappings"][optvvv]) #execute custom function >>> self.last_value=self.value >>> except NameError, e: >>> self.soc.w(["\n\nERROR: %s >>> \n\nFUNCTION or VARIABLE IS DEFINED IN JAR_CONTROLLER" % e],'white_on_red') >>> sys.exit(1) >>> #print self.opt['data'] >>> >>> #self.opt['data'][self.field]=self.fun.data[self.field] >>> #print self.opt['data'] >>> else: >>> #self.soc.write(["FUNC NOT >>> FOUND:",pfhpv[pfhpvi],self._pfmp[pfhpv[pfhpvi]]],'red') >>> #if self._pfmp[pfhpv[pfhpvi]]== >>> pfhp: >>> >>> self.opt['data']['defaults'][optv][optvvv]=self.value >>> self.last_item=self.value >>> for ff in self.final_funcs.keys(): >>> if self.final_funcs[ff]: >>> exec ( ff ) >>> >>> self.soc.me_him(['EXIT:',__name__],self.func_me_color) >>> >>> Thank you, >>> -Alex Goretoy >>> http://www.goretoy.com >>> >>> >>> >>> On Fri, Mar 13, 2009 at 11:56 PM, Gabriel Genellina < >>> gagsl-...@yahoo.com.ar> wrote: >>> >>>> prevents the interpreter from doing many optimizations... >>>> >>> >>> >> >
-- http://mail.python.org/mailman/listinfo/python-list