This is me, Wu!
Lang: python
Get the source!
Actions
Recent Pastes
python471881152 ( febrero 23, 2012 at 08:18)
MySQL (MarcosBL febrero 17, 2012 at 18:55)
my first iptables script (Wu febrero 16, 2012 at 10:48)
debian ovh server eth weird error (Wu febrero 13, 2012 at 10:10)
ledger currencies (betabug enero 22, 2012 at 20:11)
currency (betabug enero 18, 2012 at 16:29)
ledger (b diciembre 29, 2011 at 23:55)
sed parser for templates (Wu diciembre 17, 2011 at 18:59)
hg diff after mistery pull (bebu diciembre 17, 2011 at 16:10)
mailcap (bebu diciembre 16, 2011 at 11:11)
About
This is the paste site from e-shell.org, my personal website. It is an instance of the CodeSharingZ Zope Product (just take a look at http://zopecode.codigo23.net/wiki/CodeSharingZ to learn more about it). Feel free to paste whatever you want, but notice that all the pastes in here are deleted in a regular basis.
Links
L python
(http://www.python.org)

a function to set a version of a file

 1 def set_version(filename, version):
 2     """
 3     >>> set_version('filename.txt', '1827')
 4     'filename.1827.txt'
 5     >>> set_version('filename.2839.129.asd.txt', '1827')
 6     'filename.2839.129.asd.1827.txt'
 7     >>> 
 8     """
 9     tmp = filename.split('.')
10     ext = tmp.pop()
11     tmp += [version, ext]
12     return '.'.join(tmp)
Pasted by Wu on diciembre 13, 2011 at 19:04 | Lang: python | (12 lines of code)