This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

This is an useful utility for automating copy from source and destination that can be customised by arguments that may vary. A good example of usage is available with this repo.

Install

You can install it from source by cloning this repo

git clone https://github.com/blegat/smartcp.git

and running

sudo python setup.py install

You can also install the latest released version through pip

sudo pip install smartcp

or easy_install

sudo easy_install smartcp

Requirements

It is officially only compatible with Python 3 and Python 2 but has some issues with accents for Python 2 (Python 3 has a better unicode approach than Python 2).

You will also need PyYAML.

Usage

You can get help by running

smartcp -h

Config file

To specify which files to copy where, you need to specify a config file. It should use the YAML syntax. It contains a base path for the source, a base path for the destination and clients. For each client, you can specify some arguments (if no argument is given, there will be one copy but there can’t be any node arg) and how to generate the source and destination from these arguments. To specify them you need to nest three types of nodes.

  • A path_format which can contain placeholders {n} and then parameters to replace them. The parameters can be one of the three nodes.
  • A mapping which contain a hash and a key which is a node.
  • An arg which is one of the arguments.

Here is an example which copies files from version/subversion/file to file-version.subversion while renaming file to b if it is a. It also copies 1/1/x to ../x-1.1.

input_base: .
output_base: .
clients:
  - name: Official
    arguments:
      subversion: [1, 2, 3]
      version: [1, 2, 3, 4, 5]
      file: [a, A, x, X]
    input:
      path_format: "{0}/{1}/{2}"
      parameters:
        - arg: subversion
        - arg: version
        - arg: file
    output:
      path_format: "{0}-{1}.{2}"
      parameters:
        - mapping:
            a: b
          key:
            arg: file
        - arg: version
        - arg: subversion
  - name: Simple copy
    input:
      path_format: 1/1/x
    output:
      path_format: ../x-1.1

Note the " for the path format because without it YAML won’t understand that it is just a string.

Release History

Release History

0.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
smartcp-0.2.linux-x86_64.tar.gz (8.9 kB) Copy SHA256 Checksum SHA256 any Dumb Binary Feb 5, 2015
smartcp-0.2-py2.7.egg (10.5 kB) Copy SHA256 Checksum SHA256 2.7 Egg Feb 5, 2015
smartcp-0.2-py3.4.egg (10.6 kB) Copy SHA256 Checksum SHA256 3.4 Egg Feb 5, 2015
smartcp-0.2.tar.gz (6.0 kB) Copy SHA256 Checksum SHA256 Source Feb 5, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting