summaryrefslogtreecommitdiff
path: root/pato2.py
diff options
context:
space:
mode:
authorJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-04-15 04:53:27 -0500
committerJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-04-15 04:53:27 -0500
commitdeab65fad4ced009fb31f7033b1db8ef0af78aee (patch)
tree1c177c591d341b624ccfe15a40bfbc9f63697dc6 /pato2.py
parent062b7a2d9b0347e4e867e588826f052d26a3bb30 (diff)
Python parts ready for bash usage in python 2 and 3
Diffstat (limited to 'pato2.py')
-rw-r--r--pato2.py63
1 files changed, 0 insertions, 63 deletions
diff --git a/pato2.py b/pato2.py
deleted file mode 100644
index 6daa8b8..0000000
--- a/pato2.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-"""
- parabola.py
- Copyright 2009 Rafik Mas'ad
- Copyright 2010 Joshua Ismael Haase Hernández
-
- ---------- GNU General Public License 3 ----------
-
- This file is part of Parabola.
-
- Parabola is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Parabola is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Parabola. If not, see <http://www.gnu.org/licenses/>.
-
-
-"""
-from repm.config import *
-from repm.filter import *
-import tarfile
-from os.path import isdir, isfile
-
-def generate_rsync_command(base_command,
- dir_list=(config["repo_list"] +
- config["dir_list"]),
- destdir=config["repodir"],
- source=config["mirror"] +config["mirrorpath"]):
- """ Generates an rsync command for executing
- it by combining all parameters.
-
- Parameters:
- ----------
- base_command -> str
- dir_list -> list or tuple
- destdir -> str Path to dir, dir must exist.
- source -> str The source for rsync
- blacklist_file -> False or str Path to file, file must exist.
-
- Return:
- ----------
- rsync_command -> str """
- if not os.path.isdir(destdir):
- print(destdir + " is not a directory")
- raise NonValidDir
-
- dir_list="{" + ",".join(dir_list) + "}"
- return " ".join((base_command, os.path.join(source, dir_list),
- destdir))
-
-def run_rsync(command,debug=config["debug"]):
- """ Runs rsync and gets returns it's output """
- if debug:
- printf("rsync_command: " + command)
- return check_output(command.split())