Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Peter Otten <__peter__@web.de> Newsgroups: comp.lang.python Subject: Re: Generate config file from template using Python search and replace. Date: Mon, 30 Nov 2015 10:14:16 +0100 Organization: None Lines: 30 Message-ID: References: <73046000-f634-40f2-9c83-f03a5db134e6@googlegroups.com> <4f923003-4f85-4a69-bfda-165194211bb4@googlegroups.com> <0dd0db34-7f8f-4e8b-ad6a-c82ad19c2e5e@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Trace: news.uni-berlin.de IHwNhZ4bP2NUVFGF2UtFFAIL7vsLZBi4djcCxcesntlA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; 'cache': 0.05; 'that?': 0.05; 'subject:file': 0.07; 'braces': 0.09; 'literal': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'snippet': 0.09; 'subject:using': 0.09; 'template': 0.11; 'question.': 0.13; 'options"': 0.16; 'options"),': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'received:t-ipconnect.de': 0.16; 'subject:Generate': 0.16; 'subject:search': 0.16; '}}.': 0.16; 'wrote:': 0.16; '"you': 0.18; '2015': 0.20; 'permission': 0.20; 'skip:" 30': 0.20; 'posted': 0.21; 'referring': 0.22; 'sorry,': 0.22; 'words': 0.24; 'script': 0.25; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'sense': 0.26; 'see,': 0.27; 'went': 0.28; "i'm": 0.30; 'becomes': 0.30; 'supposed': 0.31; "can't": 0.32; 'run': 0.33; 'problem': 0.33; 'foo': 0.33; 'file': 0.34; 'replace': 0.35; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'subject:from': 0.39; 'to:addr:python.org': 0.40; 'received:de': 0.40; 'your': 0.60; 'incorporate': 0.66; 'otten': 0.84 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: p57bd8d86.dip0.t-ipconnect.de User-Agent: KNode/4.13.3 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:99734 Mr Zaug wrote: > On Sunday, November 29, 2015 at 5:50:51 PM UTC-5, Peter Otten wrote: >> Mr Zaug wrote: >> >> > When I run this script on OS X El Capitan, I see, >> > >> > # permission sensitive cache >> > $include "_dispatcher_shared_auth-checker: >> > >> > Was I supposed to incorporate it into the script I posted? >> >> Are you referring to my post? I'm sorry, I can't make sense of your >> question. > > Yes. The snippet you posted went way over my head. When I ran it, it > printed > > # permission sensitive cache > $include "_dispatcher_shared_auth-checker: It's hard to tell from that problem description what might have gone wrong. However: In your template file you have to enclose all words you want to replace in braces ("you have foo options" becomes "you have {foo} options"), to replace all literal { with {{ and all literal } with }}. Did you do that?