Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Load options from configuration file
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
  3 messages - 2 new - 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
 
Amirouche Boubekki  
View profile  
 More options Mar 11 2012, 11:08 am
From: Amirouche Boubekki <amirouche.boube...@gmail.com>
Date: Sun, 11 Mar 2012 08:08:22 -0700 (PDT)
Local: Sun, Mar 11 2012 11:08 am
Subject: Load options from configuration file

Héllo,

Is it possible to load startup options from a file ini ou yaml ?

Thanks in advance,


 
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.
Andy Mikhailenko  
View profile  
 More options Mar 11 2012, 11:25 am
From: Andy Mikhailenko <neith...@gmail.com>
Date: Sun, 11 Mar 2012 20:25:34 +0500
Local: Sun, Mar 11 2012 11:25 am
Subject: Re: Load options from configuration file
Hi,

> Is it possible to load startup options from a file ini ou yaml ?

I'm not sure if this is related to argh; a use case would be helpful.

Probably something like this would do:

    @command
    def foo(bar=None):
        config = yaml.load('conf.yaml')
        print(bar or config['bar'])

Of course if the app has multiple commands and each tends to load the
config, it would be a good idea to group them as class methods and
initialize the class instance with path to config, etc.

Anyway, I think configuration is out of scope of the argument parsing library.

Andy


 
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.
Amirouche Boubekki  
View profile  
 More options Mar 11 2012, 1:56 pm
From: Amirouche Boubekki <amirouche.boube...@gmail.com>
Date: Sun, 11 Mar 2012 10:56:31 -0700 (PDT)
Local: Sun, Mar 11 2012 1:56 pm
Subject: Re: Load options from configuration file

On Sunday, 11 March 2012 16:25:34 UTC+1, Andy wrote:

> Anyway, I think configuration is out of scope of the argument parsing
> library.

Me too, somewhat, I go futher in my current project and see how it goes.

Anyway some programs already use both cli arguments and config files
http://gunicorn.org/configure.html#contents


 
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 »