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


Groups > comp.lang.python > #90782

Re: Rule of order for dot operators?

Path csiph.com!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <chris@cdreimer.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.012
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'static': 0.04; '<>,': 0.07; 'string': 0.09; 'rfc': 0.09; 'wrote': 0.14; "wouldn't": 0.14; '10:17': 0.16; 'editor,': 0.16; 'folder,': 0.16; 'folder.': 0.16; 'subject:operators': 0.16; 'url:urllib': 0.16; 'urllib': 0.16; 'component': 0.16; 'folder': 0.16; 'url:)': 0.16; 'wrote:': 0.18; 'year,': 0.18; 'header:User-Agent:1': 0.23; 'from:addr:chris': 0.24; 'instead.': 0.24; 'month,': 0.24; 'source': 0.25; 'script': 0.25; 'skip:" 30': 0.26; 'post': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'respective': 0.29; 'converting': 0.30; "i'm": 0.30; 'received:10.0.0': 0.31; "skip:' 10": 0.31; 'received:dreamhost.com': 0.31; 'received:g.dreamhost.com': 0.31; 'file': 0.32; 'regular': 0.32; 'another': 0.32; 'text': 0.33; 'url:python': 0.33; 'created': 0.35; 'convert': 0.35; 'done': 0.36; "i'll": 0.36; 'subject:?': 0.36; 'received:10.0': 0.36; 'url:org': 0.36; 'received:10': 0.37; 'thank': 0.38; '(i.e.,': 0.38; 'url:library': 0.38; 'to:addr:python-list': 0.38; 'files': 0.38; 'to:addr:python.org': 0.39; 'called': 0.40; 'expression': 0.60; 'skip:2 20': 0.60; 'new': 0.61; 'url:3': 0.61; 'save': 0.62; 'name': 0.63; 'love': 0.65; 'forward': 0.65; 'cms': 0.65; 'thomas': 0.65; 'destination': 0.91; 'wordpress': 0.91
DKIM-Signature v=1; a=rsa-sha1; c=relaxed; d=cdreimer.com; h=message-id :date:from:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; s=cdreimer.com; bh=botd Z77sJesVweXHTM034w+jxvw=; b=McQen3LZqrVC0aXuVj+shEKc5UPsuJV3fkJl 0bkBDUpnCuiQE+WUiSSyFxanDQMC8RtC+D4199jx9Q+Gcd7Lv0XlgRNmFvbizZCq KfHqoMWJ8O316OgFC1BD1dcKfSs8P9RxHlEbsN6cjaC16VrsXSib6fgFAZxggLJU qagrE9Q=
Date Sun, 17 May 2015 11:35:20 -0700
From "C.D. Reimer" <chris@cdreimer.com>
User-Agent Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0
MIME-Version 1.0
To python-list@python.org
Subject Re: Rule of order for dot operators?
References <mailman.80.1431804386.17265.python-list@python.org> <3341326.d8VUBGAoep@PointedEars.de> <mailman.84.1431806129.17265.python-list@python.org> <4369306.J7Y2hDxjVg@PointedEars.de>
In-Reply-To <4369306.J7Y2hDxjVg@PointedEars.de>
Content-Type text/plain; charset=utf-8; format=flowed
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.97.1431887729.17265.python-list@python.org> (permalink)
Lines 32
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1431887729 news.xs4all.nl 2839 [2001:888:2000:d::a6]:57146
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:90782

Show key headers only | View raw


On 5/17/2015 10:17 AM, Thomas 'PointedEars' Lahn wrote:
> C.D. Reimer wrote:
>
> Consider using a regular expression or the urllib object instead. See 
> RFC 3986, Appendix B, and 
> <https://docs.python.org/3/library/urllib.html>, respectively.

That wouldn't work for me. I'm in the process of converting a WordPress 
website into a static website.

I wrote a script that pulled the HTML content from the SQL file to save 
each post in a text file with the URL as the file name (i.e., 
"2015-01-01-this-is-a-slug.html"). That created 275 files in the source 
folder.

Since I'm using Grav CMS (http://getgrav.org/) for my static website, I 
wrote a script to get the file names from the source folder, slice each 
file name into their respective component (i.e., year, month, day, slug, 
and title from the slug), convert the HTML into Markdown, and copy the 
content into a file called item.md inside a new folder (i.e., 
20150101.this-is-a-slug) in the destination folder.

After I get done cleaning up 275 item.md files in a Markdown editor, 
I'll write another script to create an .htaccess file to forward old url 
(i.e., /2015/01/01/this-is-a-slug) to the new URL (i.e., 
/blog/this-is-a-slug).

Gotta love string manipulations. ;)

Thank you,

Chris Reimer

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


Thread

Rule of order for dot operators? "C.D. Reimer" <chris@cdreimer.com> - 2015-05-16 12:20 -0700
  Re: Rule of order for dot operators? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-05-16 21:40 +0200
    Re: Rule of order for dot operators? "C.D. Reimer" <chris@cdreimer.com> - 2015-05-16 12:55 -0700
      Re: Rule of order for dot operators? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-05-17 19:17 +0200
        Re: Rule of order for dot operators? Ned Batchelder <ned@nedbatchelder.com> - 2015-05-17 10:30 -0700
          Re: Rule of order for dot operators? Rustom Mody <rustompmody@gmail.com> - 2015-05-17 12:13 -0700
        Re: Rule of order for dot operators? "C.D. Reimer" <chris@cdreimer.com> - 2015-05-17 11:35 -0700
    Re: Rule of order for dot operators? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-17 11:45 +1000
      Re: Rule of order for dot operators? Rustom Mody <rustompmody@gmail.com> - 2015-05-16 22:06 -0700
      Re: Rule of order for dot operators? Denis McMahon <denismfmcmahon@gmail.com> - 2015-05-17 15:43 +0000
        Re: Rule of order for dot operators? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-05-20 00:30 +0200
          Re: Rule of order for dot operators? Ned Batchelder <ned@nedbatchelder.com> - 2015-05-19 18:36 -0700
            Re: Rule of order for dot operators? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-05-20 04:24 +0200
              Re: Rule of order for dot operators? Ned Batchelder <ned@nedbatchelder.com> - 2015-05-19 19:44 -0700
              Re: Rule of order for dot operators? Chris Angelico <rosuav@gmail.com> - 2015-05-20 13:11 +1000
              Re: Rule of order for dot operators? Ben Finney <ben+python@benfinney.id.au> - 2015-05-20 17:29 +1000
            Re: Rule of order for dot operators? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-20 12:31 +1000
      Re: Rule of order for dot operators? "C.D. Reimer" <chris@cdreimer.com> - 2015-05-17 10:50 -0700
      Re: Rule of order for dot operators? Chris Angelico <rosuav@gmail.com> - 2015-05-18 17:40 +1000
  Re: Rule of order for dot operators? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-17 11:31 +1000
  Re: Rule of order for dot operators? Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2015-05-18 14:00 +0200

csiph-web