[Distutils] patching filelist.py to allow quoted strings
Daniel Yoo
dyoo@hkn.eecs.berkeley.edu
Sat Mar 17 23:03:00 2001
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.
--545289610-1437158962-984888123=:20909
Content-Type: TEXT/PLAIN; charset=US-ASCII
Dmitry Balabanov on python-help had requested information about why the
following Manifest.in line didn't work; he used the following line:
###
recursive-include 'Max Fray' *.txt
###
Because there were spaces in the directory, it didn't quite parse
correctly. I've isolated filelist._parse_template_line() to be
responsible for parsing out these lines.
_parse_template_line() uses a simple string.split() to break a line into
tokens. I'd like to know if it's a good idea to allow spaces in directory
names like that. I'm attaching a patch that tries to split the line and
takes quoted elements into account. I'm in digest mode, and a newbie at
distutils, so please be gentle. *grin*
---
Original message follows below:
---
>From dimonb@beep.ru Sat Mar 10 11:36:01 2001
From: dimonb@beep.ru (Balabanov Dmitry)
Date: Sat, 10 Mar 2001 11:36:01 +0000
Subject: [Python-Help] help with distutils
Message-ID: <01031011360100.00515@doors>
Hi!!
Problem is very simple but i can't solve it...
I have such string in MANIFEST.in:
recursive-include 'Max Fray' *.txt
But `python setup.py sdist --manifest-only` spawns:
running sdist
warning: sdist: missing required meta-data: url
reading manifest template 'MANIFEST.in'
warning: no files found matching 'Fray'' under directory ''Max'
warning: no files found matching '*.txt' under directory ''Max'
writing manifest file 'MANIFEST'
problem is rather simple but i don't know how to solve it with
simple methods:)
do you?
Best regards, DimonB
--545289610-1437158962-984888123=:20909
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="filelist.py.diff"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.21.0103172002030.20909@hkn.eecs.berkeley.edu>
Content-Description:
Content-Disposition: attachment; filename="filelist.py.diff"
PyBmaWxlbGlzdC5weS5kaWZmDQpJbmRleDogZGlzdHV0aWxzL2ZpbGVsaXN0
LnB5DQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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BXZSBzdGFy
dCB3aXRoIGEgcXVvdGUuDQorICAgICAgICAgICAgICAgICAgICAgICAgICAg
KCAgICAgICAgICAgICAgICAgICMgVGhlIDJuZCBncm91cCBpcyBtYWRlIG9m
DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCAgICAgICAgICAg
ICAgICMgdGhlIGZvbGxvd2luZyBjaGFyczogICANCisgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgIFxcWyJcJ10gfCAgICAgIyBBbiBlc2NhcGVk
IHF1b3RlLCBvcg0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
W15cMV0gICAgICAgICAjIGFueXRoaW5nIHRoYXQgZG9lcyBub3QNCisgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIyBt
YXRjaCB0aGUgc3RhcnQgcXVvdGUsDQorICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICApKj8gICAgICAgICAgICAgICMgd2l0aCBub24tZ3JlZWRpbmVz
cy4NCisgICAgICAgICAgICAgICAgICAgICAgICAgICApICAgICAgICAgICAg
ICAgICAgICANCisgICAgICAgICAgICAgICAgICAgICAgICAgICBcMScnJyAg
ICAgICAgICAgICAgIyBGaW5hbGx5LCBlbmQgd2l0aA0KKyAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjIHRoZSBtYXRj
aGluZyBmaXJzdCBxdW90ZS4NCisgICAgICAgICBzdHJpbmdfbGl0X3JlID0g
cmUuY29tcGlsZShzdHJpbmdfbGl0LCByZS5WRVJCT1NFKQ0KKyAgICAgICAg
IG5vbl9zcGFjZV9yZSA9IHJlLmNvbXBpbGUocicoKFteXHNdKikpJykNCisg
ICAgICAgICAjIyBUaGUgZXh0cmEgcGFyZW5zIGFsbG93IHVzIHRvIHRha2Ug
Z3JvdXAoMikgb2Ygbm9uX3NwYWNlX3JlIHRvby4NCisgICAgICAgICBpdGVt
cyA9IFtdDQorICAgICAgICAgd2hpbGUgbGluZToNCisgICAgICAgICAgICAg
bGluZSA9IHN0cmluZy5sc3RyaXAobGluZSkNCisgICAgICAgICAgICAgbTEs
IG0yID0gc3RyaW5nX2xpdF9yZS5tYXRjaChsaW5lKSwgbm9uX3NwYWNlX3Jl
Lm1hdGNoKGxpbmUpDQorICAgICAgICAgICAgIG1hdGNoID0gbTEgb3IgbTIN
CisgICAgICAgICAgICAgaWYgbWF0Y2ggYW5kIG1hdGNoLmdyb3VwKCk6DQor
ICAgICAgICAgICAgICAgICBpdGVtcy5hcHBlbmQobWF0Y2guZ3JvdXAoMikp
DQorICAgICAgICAgICAgICAgICBsX2luZGV4ID0gbWF0Y2guc3BhbigwKVsx
XQ0KKyAgICAgICAgICAgICAgICAgbGluZSA9IGxpbmVbbF9pbmRleDpdDQor
ICAgICAgICAgcmV0dXJuIGl0ZW1zDQogICAgICANCiAgICAgIGRlZiBfcGFy
c2VfdGVtcGxhdGVfbGluZSAoc2VsZiwgbGluZSk6DQohICAgICAgICAgd29y
ZHMgPSBzZWxmLl9zcGxpdF90ZW1wbGF0ZV9saW5lKGxpbmUpDQogICAgICAg
ICAgYWN0aW9uID0gd29yZHNbMF0NCiAgDQogICAgICAgICAgcGF0dGVybnMg
PSBkaXIgPSBkaXJfcGF0dGVybiA9IE5vbmUNCg==
--545289610-1437158962-984888123=:20909--