Coder Social home page Coder Social logo

bsdiff-tree's Introduction

Install

python setup.py install
or.
pip install bstree

Usage

optional arguments:
  -h, --help   show this help message and exit
  -o ORIGIN    Origin tree, base path
  -n NEW       New tree, base path
  -p PATH      absolute path to place output
  -e EXCLUDES  exclude files or directories
  -d           enable debug messages
  --version    show program's version number and exit

example

cd ~
mkdir -p origin
cd origin touch apples.txt
echo "hello world" > apples.txt
mkdir -p new
cd origin touch apples.txt
echo "findme I`m different" > apples.txt
mkdir -p files
bstree -o ~/origin -n ~/new -p ~/files

File @ /main.py

System main entry point


File @ /bsdiff_tree/init.py

Modules init.py


File @ /bsdiff_tree/main.py

Main entry for bstree

def menu:

The Menu is here


def main:

This is used in the cli and from a couple places



File @ /bsdiff_tree/modules/init.py

None


File @ /bsdiff_tree/modules/manager.py

Created on Aug 5, 2016 @author: iitow

class Manager:

handles all actions for bstree


def init:

Constructor

:param options: Dict, argparse menu options


def _walk:

performs scan on all files

:param path: String

:param excludes: List, list of excludes


def _set_arrays:

Walk both origin path & new path


def _filedelta:

get files delta of origin & new


def _fileunion:

get the union of both origin & new


def _bsdiff:

perform a bsdiff

:param base_a: String, path to file a

:param base_b: String, path to file b

:param tag: tag of file


def bsdiff:

Generate bsdiff origin file of self Generate bsdiff origin file to new file diff compare origin to new


def _write:

Write diffs found to file

:param arr: List, all files to write out to tree.diff



File @ /bsdiff_tree/modules/terminal.py

Created on Nov 18, 2015

:author: iitow

def waitfor:

poll the child for input

:param fd: forked process


def event:

find all output and inspect it for searches dict key & value

:param fd: forked process

:param searches: dictionary key value pair


def set_rsa:

logs into system via ssh and appends to authorized_keys using username password

:param host: name over the server

:param rsa_pub: absolute path to your id_rsa.pub

:param user: host login creds

:param password: host login creds

:param home_dir: home directory for user


def create_rsa_public:

generate a public key from the private key

:param rsa_private: path to private key


def ssh:

Run a single ssh command on a remote server

:param server: username@servername

:param cmd: single command you wish to run


def rsync:

Performs an rsync of files; requires ssh keys setup.

:param server: username@server

:param src: full path of src directory/file

:param dest: full path to dest directory

:param option: [pull] get file from a remote, [push] put a file from your server into a remote

:param remote: [True] assumes we are working with a remote system, [False] assumes we are copying files locally

:param excludes: exclude directory, or file from array

:note: --delete will delete files on dest if it does not match src


def sig_exception:

Listen for key exit


def shell:

Run Shell commands [Non Blocking, no Buffer, print live, log it]

:param cmd: String command

**:param verbose:**bool

**:param strict:**bool will exit based on code if enabled

:return: {command, stdout, code} as dict


def _exit_clean:

cleans .tmp_shell files before exit


bsdiff-tree's People

Watchers

 avatar

Forkers

pombredanne

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.