fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fab-user] Proposed changes to contrib.files


From: Bruno Clermont
Subject: [Fab-user] Proposed changes to contrib.files
Date: Fri, 2 Oct 2009 14:54:16 -0400

Hi everyone,
for some deployments, I had to write new operations and
I decided to implement them into fabric.contrib.files.
I wanted to share these changes, in case it's interesting enough to be
integrated.
Github is telling me that fabric's "Repository temporarily unavailable",
I can't fork it, so here is it:

Summary of changes:

* new function is_dir(remote_path) : code from some load_template().
* new function backup(remote_path):  also from load_template(), to force the
  creation of .bak of a remote file|dir.
* new function backup_and_put(local_path, remote_path): same syntax of put() it
  just call backup() before.
* put_from_text(text, remote_path): sometimes, I want to create a remote file
  from a string in memory only, it automate the creation of a temporary
  file.
* load_template() code that used to do backup and is_dir had been replaced to
  use the new functions to simplify it.

maybe, put() can have an optional backup=True|False parameter instead
this new function.

the patch is against master

Attachment: patch.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]