Skip to content

Instantly share code, notes, and snippets.

View Starou's full-sized avatar

Stanislas Guerra Starou

  • Slashdev s.a.r.l.
  • Pays de St-Malo
View GitHub Profile
@Starou
Starou / ftprmtree.py
Last active August 29, 2015 14:07 — forked from artlogic/ftprmtree.py
def rmtree_ftp(ftp, path):
"""Recursively delete a directory tree on a remote server."""
wd = ftp.pwd()
try:
names = ftp.nlst(path)
except ftplib.all_errors as e:
# some FTP servers complain when you try and list non-existent paths
#_log.debug('FtpRmTree: Could not remove {0}: {1}'.format(path, e))
return
@Starou
Starou / daterange.py
Last active September 26, 2015 01:27 — forked from jacobian/daterange.py
PEP8
# -*- coding: utf-8 -*-
"""
Example Usage
=============
>>> import datetime
>>> start = datetime.date(2009, 6, 21)