Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #44863

Re: python backup script

Path csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python@mrabarnett.plus.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'username,': 0.07; 'feature.': 0.09; 'idea?': 0.09; 'spelling': 0.09; 'subject:script': 0.09; '(remember': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'hostname': 0.16; 'inclined': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'nameerror:': 0.16; 'notation': 0.16; 'password,': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'shell': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; "aren't": 0.24; 'right.': 0.26; 'pass': 0.26; 'defined': 0.27; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'username': 0.31; 'file': 0.32; 'stuff': 0.32; '(most': 0.33; 'monday,': 0.33; 'used,': 0.33; 'actual': 0.34; 'skip:d 20': 0.34; "i'd": 0.34; 'problem': 0.35; 'received:84': 0.35; 'thanks': 0.36; 'so,': 0.37; 'clear': 0.37; 'to:addr:python- list': 0.38; 'fact': 0.38; 'recent': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'break': 0.61; 'new': 0.61; 'name': 0.63; 'worth': 0.66; 'header:Reply-To:1': 0.67; 'fact,': 0.69; 'reply- to:no real name:2**0': 0.71; 'reply-to:addr:python.org': 0.84; 'directly.': 0.95; '2013': 0.98
X-CM-Score 0.00
X-CNFS-Analysis v=2.1 cv=JsTI8qIC c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=7AxPfEIvyrUA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=ytLhUI_Y_LYA:10 a=pGLkceISAAAA:8 a=X3vMQriGQ_tNs7TycREA:9 a=wPNLvfGTeEIA:10 a=MSl-tDqOz04A:10
X-AUTH mrabarnett:2500
Date Mon, 06 May 2013 23:52:53 +0100
From MRAB <python@mrabarnett.plus.com>
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130328 Thunderbird/17.0.5
MIME-Version 1.0
To python-list@python.org
Subject Re: python backup script
References <b586db98-78b2-40a6-9e1c-3d8b939657c8@googlegroups.com> <mailman.1388.1367878356.3114.python-list@python.org> <f71a2143-a379-4c0c-9bdb-1a8b2cb15d79@googlegroups.com>
In-Reply-To <f71a2143-a379-4c0c-9bdb-1a8b2cb15d79@googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To python-list@python.org
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1391.1367880770.3114.python-list@python.org> (permalink)
Lines 47
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1367880770 news.xs4all.nl 15999 [2001:888:2000:d::a6]:35853
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:44863

Show key headers only | View raw


On 06/05/2013 23:40, MMZ wrote:
> On Monday, May 6, 2013 6:12:28 PM UTC-4, Chris Angelico wrote:
>> On Tue, May 7, 2013 at 5:01 AM, MMZ <programmer.toronto@gmail.com> wrote:
>>
>> > username = config.get('client', 'mmz')
>>
>> > password = config.get('client', 'pass1')
>>
>> > hostname = config.get('client', 'localhost')
>>
>>
>>
>> Are 'mmz', 'pass1', and 'localhost' the actual values you want for
>>
>> username, password, and hostname? If so, don't pass them through
>>
>> config.get() at all - just use them directly. In fact, I'd be inclined
>>
>> to just stuff them straight into the Database_list_command literal;
>>
>> that way, it's clear how they're used, and the fact that you aren't
>>
>> escaping them in any way isn't going to be a problem (tip: an
>>
>> apostrophe in your password would currently break your script).
>>
>>
>>
>> It's also worth noting that the ~/ notation is a shell feature. You
>>
>> may or may not be able to use it in config.read().
>>
>>
>>
>> ChrisA
>
> Thanks Chris. you are right.
> So I used them directly and removed configParser. The new error is:
>
> Traceback (most recent call last):
>    File "./bbk.py", line 11, in ?
>      for database in os.popen(database_list_command).readlines():
> NameError: name 'database_list_command' is not defined
>
> any idea?
>
Check the spelling (remember that the name is case-sensitive).

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

python backup script MMZ <programmer.toronto@gmail.com> - 2013-05-06 12:01 -0700
  Re: python backup script Jerry Hill <malaclypse2@gmail.com> - 2013-05-06 15:11 -0400
    Re: python backup script MMZ <programmer.toronto@gmail.com> - 2013-05-06 12:20 -0700
      Re: python backup script Matt Jones <matt.walker.jones@gmail.com> - 2013-05-06 14:46 -0500
        Re: python backup script MMZ <programmer.toronto@gmail.com> - 2013-05-06 13:37 -0700
          Re: python backup script Matt Jones <matt.walker.jones@gmail.com> - 2013-05-06 16:08 -0500
  Re: python backup script Enrico 'Henryx' Bianchi <henryx_b@yahoo.it> - 2013-05-06 23:44 +0200
    Re: python backup script Enrico 'Henryx' Bianchi <henryx_b@yahoo.it> - 2013-05-06 23:48 +0200
      Re: python backup script mina@socialassets.org - 2013-05-06 15:12 -0700
        Re: python backup script John Gordon <gordon@panix.com> - 2013-05-06 22:15 +0000
          Re: python backup script Enrico 'Henryx' Bianchi <henryx_b@yahoo.it> - 2013-05-07 21:11 +0200
        Re: python backup script MRAB <python@mrabarnett.plus.com> - 2013-05-06 23:28 +0100
      Re: python backup script MMZ <programmer.toronto@gmail.com> - 2013-05-06 15:15 -0700
  Re: python backup script Chris Angelico <rosuav@gmail.com> - 2013-05-07 08:12 +1000
    Re: python backup script MMZ <programmer.toronto@gmail.com> - 2013-05-06 15:40 -0700
      Re: python backup script Chris Angelico <rosuav@gmail.com> - 2013-05-07 08:51 +1000
      Re: python backup script MRAB <python@mrabarnett.plus.com> - 2013-05-06 23:52 +0100
  Re: python backup script Peter Otten <__peter__@web.de> - 2013-05-07 08:18 +0200

csiph-web