MCPcopy Create free account
hub / github.com/ActiveState/code / info

Function info

recipes/Python/576777_Simple_FTP_Mirror/recipe-576777.py:316–334  ·  view source on GitHub ↗
(remote)

Source from the content-addressed store, hash-verified

314
315
316def info(remote):
317 try:
318 sfmstat = remote.readlines(os.path.join(remote.root, '.sfmstat'))
319 except ftplib.error_perm, err:
320 if not err[0].startswith('550'):
321 log(err, abort=True)
322 sfmstat = None
323 print
324 if sfmstat:
325 last_updated, mirror_path = sfmstat[0].split(None, 1)
326 last_updated = datetime.datetime.fromtimestamp(float(last_updated))
327 print 'Mirror of', mirror_path
328 print last_updated.strftime('Last updated on %A, %d. %B %Y at %H:%M:%S')
329 else:
330 print 'No mirror recognized'
331 print
332 print 'Content of %s%s:' % (remote.host, remote.root)
333 remote.ftp.dir(remote.root)
334 print
335
336
337def remove(remote):

Callers 3

removeFunction · 0.70
mainFunction · 0.70
recipe-224043.pyFile · 0.50

Calls 5

startswithMethod · 0.80
logFunction · 0.70
readlinesMethod · 0.45
joinMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected