Orkut Gmail Calendar Documents Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
reducing stdout verbosity
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
molicule  
View profile  
 More options Oct 21 2009, 9:43 pm
From: molicule <molic...@gmail.com>
Date: Wed, 21 Oct 2009 09:13:04 -0700 (PDT)
Local: Wed, Oct 21 2009 9:43 pm
Subject: reducing stdout verbosity
Hi,

Thanks for coming up with doit, it's great to not have to always worry
about targets.

Now, when I use a task generator and it creates tasks by looping
through files
in all subdirs, it creates a bunch of sub tasks. (You have noted that
this is a
bug and  you hope to change that). The output though is extremely
verbose
especially when there are 100's of files. There is a line for each
file/sub task
which starts with "---" and there is a group task dump which outputs a
comma separated list of all the tasks.

If there is a way/command line switch or setting within the dodo
file where I can set this output verbosity that would be great.
Ideally, I
only want task info to print if executed so no "---" lines and
no Group lines.

Thanks
S. Sriram


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eduardo Schettino  
View profile  
 More options Oct 22 2009, 4:40 am
From: Eduardo Schettino <schettin...@gmail.com>
Date: Thu, 22 Oct 2009 07:10:03 +0800
Local: Thurs, Oct 22 2009 4:40 am
Subject: Re: reducing stdout verbosity
Hi

On Thu, Oct 22, 2009 at 12:13 AM, molicule <molic...@gmail.com> wrote:
> Thanks for coming up with doit, it's great to not have to always worry
> about targets.

I am glad to hear that. it seems only a few people get it!

> Now, when I use a task generator and it creates tasks by looping
> through files
> in all subdirs, it creates a bunch of sub tasks. (You have noted that
> this is a
> bug and  you hope to change that).

I dont know how could I change that. It is very important to be able
to execute sub-tasks individually. So there is no other way than
creating a bunch of subtasks. Do you have anything in mind?

> The output though is extremely
> verbose
> especially when there are 100's of files. There is a line for each
> file/sub task
> which starts with "---" and there is a group task dump which outputs a
> comma separated list of all the tasks.

Yes. the output is a problem. And I guess it is impossible to have one
style that will satisfy all use cases. So the way to go is to make it
more customisable.

> If there is a way/command line switch or setting within the dodo
> file where I can set this output verbosity that would be great.
> Ideally, I
> only want task info to print if executed so no "---" lines and
> no Group lines.

as of today you can only control the verbosity of the task output
itself with "--verbose". and even that is not flexible. there is a
ticket to control the output from the task itself (see
http://groups.google.com/group/python-doit/browse_thread/thread/138cc...
) but I guess thats not what you are looking for...

if you look into the code in trunk you will notice that I already
separated the output reporting code from the runner itself. I guess
the best you can do is to take a look into that (
http://bazaar.launchpad.net/~schettino72/doit/trunk/annotate/head%3A/...
)

Try to create a new "reporter" that suit your needs, it should be
really easy to write a new one. If that is not enough please suggest
what kind of command line switch or setting within the dodo file you
would like to have. It makes my life easier this way :) if you send me
a patch even better ;)

Note that as of today the "reporter" is hard-coded on runner.py i plan
to add a command line switch for that soon...

Regards,
  Eduardo


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
molicule  
View profile  
 More options Oct 22 2009, 9:31 pm
From: molicule <molic...@gmail.com>
Date: Thu, 22 Oct 2009 09:01:07 -0700 (PDT)
Local: Thurs, Oct 22 2009 9:31 pm
Subject: Re: reducing stdout verbosity
Hi,

> > Now, when I use a task generator and it creates tasks by looping
> > through files
> > in all subdirs, it creates a bunch of sub tasks. (You have noted that
> > this is a
> > bug and  you hope to change that).

> I dont know how could I change that. It is very important to be able
> to execute sub-tasks individually. So there is no other way than
> creating a bunch of subtasks. Do you have anything in mind?

I think a rake-like approach may work. In rake functions are used to
build
tasks as opposed to tasks being functions forcing tasks they generate
to become
sub tasks. So one way to do it in doit could be to build instances of
a
Task class within a dodo file as opposed to doit introspecting
task_foo functions
as tasks.

> Try to create a new "reporter" that suit your needs, it should be
> really easy to write a new one. If that is not enough please suggest
> what kind of command line switch or setting within the dodo file you
> would like to have. It makes my life easier this way :) if you send me
> a patch even better ;)

> Note that as of today the "reporter" is hard-coded on runner.py i plan
> to add a command line switch for that soon...

I think allowing people to write their own reporter plugins is a
good idea this way even in dodo.py debug output could be
seamlessly integrated with doit command output.

I will look into the code to see about writing a new reporter.

Thanks
S. Sriram


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eduardo Schettino  
View profile  
 More options Oct 23 2009, 2:43 pm
From: Eduardo Schettino <schettin...@gmail.com>
Date: Fri, 23 Oct 2009 17:13:51 +0800
Local: Fri, Oct 23 2009 2:43 pm
Subject: Re: reducing stdout verbosity

On Fri, Oct 23, 2009 at 12:01 AM, molicule <molic...@gmail.com> wrote:
> I think a rake-like approach may work. In rake functions are used to
> build
> tasks as opposed to tasks being functions forcing tasks they generate
> to become
> sub tasks. So one way to do it in doit could be to build instances of
> a
> Task class within a dodo file as opposed to doit introspecting
> task_foo functions
> as tasks.

My point was you need a bunch of separate tasks, doesnt matter if they are
sub-tasks or not. Or how you create it. Each sub-task is actually an
independent
task. "sub-task" is only meta-information from how it was defined. I
don't get what
is really bothering you from sub-tasks...

doit supports a task with as many actions as you wish. thats another
option instead of
creating many sub-tasks. but they will always be executed together.

I don't know what is rake-like approach... I guess you mean that a
function is the task itself
(or the task-action itself).

In doit task_xxx() => this function is a "task generator" task are
build from the dictionaries
a task generators returns. In case a task generator defines more than
one task doit creates
a "group task" ( that is  a task with no action that depends on all
its sub-tasks), and a bunch
of sub-tasks from the returned dictionaries.

doit design is that a task should be declarative it has actions, dependencies,
targets, ... but you use python to create it. It wouldnt be hard to make doit
read tasks from a text (or XML) file instead of reading it from a dodo file.
the dodo file is just used to generate tasks.

Do you want that a task generator returns many tasks but the tasks are
not sub-tasks?
If this is what you want it wont be hard :) As of today a task
generator can return a dictionary
 or a python-generator. It doesnt accept lists. So we could say that a
task generator could also
return a list of dictionaries, where every dictionary will describe a
different task without associating
them as a sub-task.

> I think allowing people to write their own reporter plugins is a
> good idea this way even in dodo.py debug output could be
> seamlessly integrated with doit command output.

> I will look into the code to see about writing a new reporter.

cool. I am also interested in a less verbose reporter. I will probably
include yours
on the distribution code ;)

Regards,
  Eduardo


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
molicule  
View profile  
 More options Oct 24 2009, 12:27 am
From: molicule <molic...@gmail.com>
Date: Fri, 23 Oct 2009 11:57:18 -0700 (PDT)
Local: Sat, Oct 24 2009 12:27 am
Subject: Re: reducing stdout verbosity
Hi,

> task. "sub-task" is only meta-information from how it was defined. I
> don't get what
> is really bothering you from sub-tasks...

The only thing that bothered me was the output since each of my tasks
created
a couple of hundred subtasks and  the output was verbose, but by
creating MyReporter
and having this in execute_task i.e. if task.title().find("=>
Group:") != -1: it gets
rid of that output so my current problem is solved.

> I don't know what is rake-like approach... I guess you mean that a
> function is the task itself
> (or the task-action itself).

No. rake is ruby's approach to make and is quite versatile and you
can look at their simple tasks at http://rake.rubyforge.org/ to get
a general idea.

In fact I think writing a python FileList ala rake and adding it to
doit.tools would make a
lot of sense. in ruby IN_FILES = FileList['**/*.in'] creates a list of
ALL .in files including
those in subdirs.

> Do you want that a task generator returns many tasks but the tasks are
> not sub-tasks?

For now i'm fine since the verbose output has been squelched.

S. Sriram


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eduardo Schettino  
View profile  
 More options Oct 24 2009, 11:20 am
From: Eduardo Schettino <schettin...@gmail.com>
Date: Sat, 24 Oct 2009 13:50:53 +0800
Local: Sat, Oct 24 2009 11:20 am
Subject: Re: reducing stdout verbosity

On Sat, Oct 24, 2009 at 2:57 AM, molicule <molic...@gmail.com> wrote:
> In fact I think writing a python FileList ala rake and adding it to
> doit.tools would make a
> lot of sense. in ruby IN_FILES = FileList['**/*.in'] creates a list of
> ALL .in files including
> those in subdirs.

My idea was to NOT integrate file manipulation into doit. so you can
use anything you want. Have you seen path.py
(http://pypi.python.org/pypi/path.py). Since path.py is not being
maintained and I guess this recursive pattern match is very common, I
think it makes sense to add it to doit.tools.

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google