Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #94993
| Return-Path | <torriem+gmail@torriefamily.org> |
|---|---|
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.001 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'anyway.': 0.04; 'familiarity': 0.07; 'subject:skip:c 10': 0.07; "django's": 0.09; 'imports': 0.09; 'methods,': 0.09; 'section,': 0.09; 'python': 0.10; 'python.': 0.11; 'anyway': 0.11; 'files.': 0.13; 'syntax': 0.13; 'django': 0.13; 'dsl,': 0.16; 'file?': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'pressed': 0.16; 'simpson': 0.16; 'wrote:': 0.16; 'config': 0.18; 'flexibility': 0.18; 'say,': 0.18; 'either.': 0.22; 'referring': 0.22; 'simpler': 0.22; 'header:In-Reply-To:1': 0.24; 'header:User- Agent:1': 0.26; "doesn't": 0.26; 'example': 0.26; 'least': 0.27; 'really,': 0.29; 'subset': 0.29; 'read,': 0.29; "i'm": 0.30; 'classes': 0.30; 'that.': 0.30; 'work.': 0.30; 'code': 0.30; 'certain': 0.31; 'subject:) ': 0.32; 'maybe': 0.33; "he's": 0.33; 'purposes,': 0.33; 'that!': 0.33; 'message-id:@gmail.com': 0.34; 'case,': 0.34; 'file': 0.34; 'could': 0.35; 'text': 0.35; 'files,': 0.35; 'mapping': 0.35; 'mine': 0.35; 'something': 0.35; 'but': 0.36; 'project': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'doing': 0.38; 'someone': 0.38; 'sure': 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'charset:windows-1252': 0.62; 'different': 0.63; 'complete': 0.63; 'experience.': 0.66; 'cameron': 0.66; 'cut': 0.67; 'cecil': 0.84; "op's": 0.84; 'samba': 0.84 |
| X-Virus-Scanned | amavisd-new at torriefamily.org |
| Date | Tue, 04 Aug 2015 22:55:59 -0600 |
| From | Michael Torrie <torriem@gmail.com> |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
| MIME-Version | 1.0 |
| To | python-list@python.org |
| Subject | Re: Most Pythonic way to store (small) configuration |
| References | <55C16796.9060101@gmail.com> <20150805021953.GA65285@cskk.homeip.net> |
| In-Reply-To | <20150805021953.GA65285@cskk.homeip.net> |
| Content-Type | text/plain; charset=windows-1252 |
| Content-Transfer-Encoding | 7bit |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.20+ |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1228.1438750565.3674.python-list@python.org> (permalink) |
| Lines | 27 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1438750565 news.xs4all.nl 2822 [2001:888:2000:d::a6]:32920 |
| X-Complaints-To | abuse@xs4all.nl |
| Path | csiph.com!usenet.pasdenom.info!news.stben.net!border1.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
| Xref | csiph.com comp.lang.python:94993 |
Show key headers only | View raw
On 08/04/2015 08:19 PM, Cameron Simpson wrote: > So on the whole I am against python code as the config file format. Really, who > needs a Turing complete configuration file? In Django's case, since you're intimately referring to certain classes and methods, particularly in the url mapping section, I think using straight Python is the way to go. It's the most flexibility for the least amount of work. And someone working with Django already has familiarity with both Django and Python. I'm sure everything could be put in a DSL, but then you'd be inventing a subset of Python anyway. And like I say, since the same person editing the config file is also editing the other Django project files, the issue of code injection is moot; he's already doing that! So for the OP's case, if his needs are simple like mine are, then a simple python file he imports could be just fine. I'm hard pressed to make a case for something different if the needs are simple like that. > Go with something simple, both in syntax and semantics. It is easier to read, > easier to write/modify, and easier to access from multiple tools. Python as configuration is simpler for my purposes, in both ways. And multiple tools for me == text editors. I have no need of machine-generated config files. Maybe Cecil doesn't either. Such tools are of limited use anyway in my experience. For example webadmin never cut it for me. Neither did the old web-based Samba configurater.
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Most Pythonic way to store (small) configuration Michael Torrie <torriem@gmail.com> - 2015-08-04 22:55 -0600
csiph-web