Closed GoogleCodeExporter closed 9 years ago
thanks for the patch! I won't hold it against you that you lumped everything
together.
I like your suggestions, and committed the first two, only after changing -n and
--name into -m and --makefile (is there a reason you didn't use -m?). but
unfortunately, in a cruel twist of fate, I just merged a distutils-based
setup.py
this morning.. (after 5 years without a distutils script, I receive two on the
same
day!?) but please let me know if you think some part of your solution is better.
your changes will be released as part of shedskin 0.3, within a few days:
http://code.google.com/p/shedskin/wiki/ReleaseNotes?ts=1263068276&updated=Releas
eNotes
thanks a lot!
Original comment by mark.duf...@gmail.com
on 9 Jan 2010 at 8:19
oh, let me know if you'd like me to change your name in the release notes.
Original comment by mark.duf...@gmail.com
on 9 Jan 2010 at 8:20
btw, note that this doesn't work:
#{
''' oink '''
print 'from python'
#}
perhaps you'd like to fix this, using a simple state machine or something?
Original comment by mark.duf...@gmail.com
on 9 Jan 2010 at 8:58
Wow, you're quick, I guess I should have checked on this yesterday.
I think that '-m --makefile' is an excellent choice.
Use mike.schrick in the release notes.
I realize that ''' can not be used inside the block comments as I have
implemented
it. I suppose I was a bit lazy, but you can still use """. A simple state
machine
which really comments out the block would be a better implementation, but this
at
least is a start.
Thanks again for a great project!
Mike
Original comment by schric...@gmail.com
on 10 Jan 2010 at 2:29
thanks for the help! I will leave the issue open until there is an improved
implementation for ignoring the block comments (thinking about it again, can't
we
just improve the regular expression to match both begin and end markers at the
same
time..?)
Original comment by mark.duf...@gmail.com
on 10 Jan 2010 at 3:15
how about the following?
pat = re.compile(r"#{.*?#}", re.MULTILINE | re.DOTALL)
filebuf = re.sub(pat, '', open(name).read())
as this seems at least an improvement, I commited it to SVN.
Original comment by mark.duf...@gmail.com
on 10 Jan 2010 at 6:00
I think you're solution to block comments is much better.
thanks,
Mike
Original comment by schric...@gmail.com
on 10 Jan 2010 at 7:54
alright, we'll keep this one for now then. thanks again. closing the issue..
Original comment by mark.duf...@gmail.com
on 10 Jan 2010 at 8:40
reopening, read() and then parse() doesn't work with DOS text files under UNIX
(and
possibly the other way around..).
Original comment by mark.duf...@gmail.com
on 11 Jan 2010 at 12:29
Original comment by mark.duf...@gmail.com
on 11 Jan 2010 at 12:29
thanks to jeremie, this works from UNIX at least (haven't tested windows yet):
filebuf = re.sub(pat, '', ''.join(open(name, 'U').readlines()))
Original comment by mark.duf...@gmail.com
on 11 Jan 2010 at 3:05
works on under windows too, closing the issue again.. :P
Original comment by mark.duf...@gmail.com
on 11 Jan 2010 at 7:05
Original issue reported on code.google.com by
schric...@gmail.com
on 9 Jan 2010 at 7:21Attachments: