On Fri, Feb 6, 2009 at 4:35 AM, Chuck Rhode <crh...@lacusveris.com> wrote: > > achipa wrote this on Thu, Feb 05, 2009 at 03:53:31PM -0800. My reply is > below. > >> One more example of 'I didn't quite expect this': >> >> if os.name == 'nt': >> proc = Popen([self.cmd], stdin=PIPE, stdout=PIPE, >> stderr=PIPE, shell=True) >> else: >> proc = Popen( >> [self.cmd], >> stdin=PIPE, >> stdout=PIPE, >> stderr=PIPE, >> shell=True, >> close_fds=True, >> ) > > Heh! The number of arguments is six in the second instantiation of > *Popen*, which exceeds MAX_SEPS_FUNC_REF in *PythonTidy* and forces > each argument onto a separate line. > >> MAX_SEPS_FUNC_DEF = 3 >> MAX_SEPS_FUNC_REF = 5 >> MAX_SEPS_SERIES = 5 >> MAX_SEPS_DICT = 3 > > This goes beyond PEP8. I have some experience as a maintenance > programmer. When series (of parameters for example) get long (beyond > some arbitrarily small number), it's cumbersome to test changes in one > member. If each member occupies its own line, it's relatively easy to > comment out the old code, leaving it inactive but in place so it's > convenient to restore when testing is complete.
So when increasing these values multiple arguments in the original file do not get put inte separate lines when running through PythonTidy, which is good. However, when the original file already contained parameters on multiple lines, they also get converted into a single line, which is not what I expected: e.g.: w.setDatesToMark( set( ( datetime.date( 2006, 2, 27 ), datetime.date( 2006, 3, 6 ), datetime.date( 2006, 3, 8 ), datetime.date( 2006, 3, 15 ) ) ) ) translates to w.setDatesToMark(set((datetime.date(2006, 2, 27), datetime.date(2006, 3, 6), datetime.date(2006, 3, 8), datetime.date(2006, 3, 15)))) Is there a way to prevent this and keep the original line breaks? Markus --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---