Keep array well indented after pretty-print

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Keep array well indented after pretty-print

woprandi
Hi,

I use pretty-print to keep a consistent code but arrays is now written in a single-line (so I can have line length over than 200 characters).
How configure that ?
Reply | Threaded
Open this post in threaded view
|

Re: Keep array well indented after pretty-print

Richard Sternagel
Hi woprandi,

this isn't possible. You only can influence the overall
text-width [1].

Regards
Richard

[1]
manual.qooxdoo.org/devel/pages/tool/generator/generator_config_ref.html#pretty-print

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Keep array well indented after pretty-print

woprandi
Hi Richard,

Thanks for your fast answer. I added text-width in config.json but I got this error :

./generate.py pretty

----------------------------------------------------------------------------
    Initializing: frontend
----------------------------------------------------------------------------
>>> Processing configuration

----------------------------------------------------------------------------
    Executing: pretty
----------------------------------------------------------------------------
>>> Scanning libraries  
>>> Pretty-printing code...
  - Pretty-printing files: <type 'exceptions.TypeError'> :
add() takes exactly 4 arguments (3 given)

Other pretty-print keys works (indent-string)
Do you have an idea ?
Reply | Threaded
Open this post in threaded view
|

Re: Keep array well indented after pretty-print

Richard Sternagel
Which downloadable qooxdoo SDK version or branch (e.g. master) are you
using?

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Keep array well indented after pretty-print

woprandi
Last version (4.0.1)
Reply | Threaded
Open this post in threaded view
|

Re: Keep array well indented after pretty-print

Richard Sternagel
I can't reproduce this behavior with this version (with a fresh
downloaded SDK). Are you sure?

Am 17.11.14 um 10:46 schrieb woprandi:

> Last version (4.0.1)
>
>
>
> --
> View this message in context: http://qooxdoo.678.n2.nabble.com/Keep-array-well-indented-after-pretty-print-tp7586378p7586383.html
> Sent from the qooxdoo mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Keep array well indented after pretty-print

woprandi
Hi,

sorry for this late answer, I cannot reproduce with fresh qooxdoo app but this is the stack trace

./generate.py pretty -s

----------------------------------------------------------------------------
    Initializing: frontend
----------------------------------------------------------------------------
>>> Processing configuration

----------------------------------------------------------------------------
    Executing: pretty
----------------------------------------------------------------------------
>>> Scanning libraries  
>>> Pretty-printing code...
  - Pretty-printing files: Traceback (most recent call last):
  File "/srv/001/intranet/resources/qooxdoo/tool/bin/generator.py", line 268, in <module>
    main()
  File "/srv/001/intranet/resources/qooxdoo/tool/bin/generator.py", line 259, in main
    generatorObj.run()
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/generator/Generator.py", line 538, in run
    self._codeGenerator.runPrettyPrinting(self._classesObj)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/generator/output/CodeGenerator.py", line 889, in runPrettyPrinting
    result = formatter_3.formatNode(tree, options, result)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 677, in formatNode
    tree.format(options, state)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 44, in format
    cld.format(optns, state)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 44, in format
    cld.format(optns, state)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 377, in format
    cld.format(optns, state)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 384, in format
    self.getChild("arguments").format(optns, state)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 44, in format
    cld.format(optns, state)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 223, in format
    c.format(optns,state)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 241, in format
    self.children[2].format(optns, state)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 44, in format
    cld.format(optns, state)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 223, in format
    c.format(optns,state)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 241, in format
    self.children[2].format(optns, state)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 44, in format
    cld.format(optns, state)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 252, in format
    self.getChild("body").format(optns, state)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 44, in format
    cld.format(optns, state)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 44, in format
    cld.format(optns, state)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 44, in format
    cld.format(optns, state)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 377, in format
    cld.format(optns, state)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 384, in format
    self.getChild("arguments").format(optns, state)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 44, in format
    cld.format(optns, state)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 44, in format
    cld.format(optns, state)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 190, in format
    state.add(self.write(v),self, optns)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 524, in add
    self.handle_text_width(fragment, tokenOrArr, optns)
  File "/srv/data/qooxdoo/qooxdoo-4.1-sdk/tool/pylib/ecmascript/backend/formatter_3.py", line 602, in handle_text_width
    self.add(('\n',_),optns)
TypeError: add() takes exactly 4 arguments (3 given)

Do you have any idea ?
Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Keep array well indented after pretty-print

thron7
yep, this is a bug.

for a quick fix, remove the inner parens so that the offending code line reads

   self.add('\n',_,optns)

this should work as a work-around.

t.


On Thu, Jan 8, 2015 at 4:05 PM, woprandi <[hidden email]> wrote:
Hi,

sorry for this late answer, I cannot reproduce with fresh qooxdoo app but
this is the stack trace



Do you have any idea ?
Thanks



--
View this message in context: http://qooxdoo.678.n2.nabble.com/Keep-array-well-indented-after-pretty-print-tp7586378p7586617.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Keep array well indented after pretty-print

woprandi
Thanks, it works now