Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed0.kamp.net!newsfeed.kamp.net!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.87.MISMATCH!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:code': 0.07; 'inserts': 0.09; 'required,': 0.09; 'works.': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; 'changes': 0.15; 'definition.': 0.16; 'detects': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'invoked.': 0.16; 'subject:python': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'aug': 0.22; 'cc:addr:python.org': 0.22; 'directory.': 0.24; 'cc:2**0': 0.24; '(for': 0.26; 'certain': 0.27; 'gets': 0.27; 'header:In-Reply- To:1': 0.27; 'idea': 0.28; 'am,': 0.29; 'xml': 0.29; 'needed.': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'file': 0.32; 'run': 0.32; 'running': 0.33; "i'd": 0.34; 'display': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'depends': 0.38; 'handle': 0.38; 'whatever': 0.38; 'files': 0.38; 'how': 0.40; 'such': 0.63; '30,': 0.65; 'frank': 0.68; 'reads': 0.68; '100%': 0.77; 'sitting': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=us5yuzpWhIH9WL2tHMaWDM6ao3uRF2dvyRjrzW8uMiE=; b=NI65nEXtWGJhUT3PcJ082I0KVPOyLjKKZ2RAm/wzMz3BUf03IgXePcUVyFKcMQwGny ZXMPOhAFI7t0uj71zVSEVt7NxiCTYB+Ijyhg26mZU/NWgffQC8fYBy3T0eJ63QmiBHN6 ugsCyL/35GdEdjmvPZsUeEI66F14B7sbrzkUk1Yw+CzuxISIHLJCHEs71EYg1t7jK+3F qnYg85Za+q+QM0IaB47YQAWjESOFI8hfcLpzWFdhVWoTLminWBVZQFr529kVrxlNubGk PrfYaxdLYR/tG326L8N++4rJUF/Q8vcc+YicxPDjLAFV50d6BBqVyKLhkqvA8q0JQQEG 2Svw== MIME-Version: 1.0 X-Received: by 10.50.176.169 with SMTP id cj9mr4428972igc.14.1409321964771; Fri, 29 Aug 2014 07:19:24 -0700 (PDT) In-Reply-To: References: Date: Sat, 30 Aug 2014 00:19:24 +1000 Subject: Re: Keeping python code and database in sync From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1409321973 news.xs4all.nl 2872 [2001:888:2000:d::a6]:34398 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:77277 On Sat, Aug 30, 2014 at 12:12 AM, Frank Millman wrote: > Once downloaded, the 'py' files are automatically 'live', because that is > how python works. But the xml file will just be sitting in a directory. > *Something* has to trigger running a program that reads the xml file and > inserts it into the database. I'm not 100% certain of this distinction, but it depends on how your code gets invoked. > My idea is to put the 'version number check' in the main program 'start.py'. > If it detects that an upgrade is required, it will display a warning message > to the user and then run the upgrade program. The same upgrade program can > handle both 'schema' changes and (for want of a word) 'meta-data' changes > such as the menu definition. Yes... or start.py can do it directly and automatically, just check and do whatever changes are needed. That's how I'd do it. ChrisA