Removed unused scripts and files

This commit is contained in:
DariusIII
2014-05-04 15:34:16 +02:00
parent 41a9db6639
commit 1a15f458a6
10 changed files with 0 additions and 394 deletions
-65
View File
@@ -1,65 +0,0 @@
#!/usr/bin/env python
# Written by convict
import sys, os, shutil
import platform, subprocess, re, os, json, urllib2
def runGit(args):
git_locations = ['git']
run_dir = os.getcwd()
if platform.system().lower() == 'darwin':
git_locations.append('/usr/local/git/bin/git')
output = err = None
for cur_git in git_locations:
cmd = cur_git + ' ' + args
try:
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True, cwd=run_dir)
output, err = p.communicate()
except OSError:
print 'Command "%s" did not work. Could not find git.' % cmd
continue
if 'not found' in output or 'not recognized as an internal or external command' in output:
print 'Unable to find git with command "%s"' % cmd
output = None
elif 'fatal:' in output or err:
print 'Git returned bad info. Are you sure this is a git installation?'
output = None
elif output:
break
return (output, err)
def gitCurrentVersion():
output, err = runGit('rev-parse HEAD')
if not output:
print 'Could not find latest installed version with git.'
return None
current_commit = output.strip()
if not re.match('^[a-z0-9]+$', current_commit):
print 'Git output does not look like a hash, not using it.'
return None
return current_commit
def latestCommit():
url = 'https://api.github.com/repos/DariusIII/newznab-tmux/commits/master'
result = urllib2.urlopen(url).read()
git = json.JSONDecoder().decode(result)
return git['sha']
def commitsBehind():
url = 'https://api.github.com/repos/DariusIII/newznab-tmux/compare/%s...%s' % (gitCurrentVersion(), latestCommit())
try:
result = urllib2.urlopen(url).read()
except urllib2.HTTPError:
return None
git = json.JSONDecoder().decode(result)
return git['total_commits']
if __name__ == '__main__':
print 'You are %s commits behind.' % commitsBehind()
-30
View File
@@ -1,30 +0,0 @@
<?php
require(dirname(__FILE__) . "/../bin/config.php");
require_once(WWW_DIR . "/lib/framework/db.php");
$db = new DB;
$rel = $db->query("update groups set backfill_target=0, first_record=0, first_record_postdate=null, last_record=0, last_record_postdate=null, last_updated=null");
printf("Reseting all groups completed.\n");
$arr = array("parts", "partrepair", "binaries");
foreach ($arr as &$value) {
$rel = $db->query("truncate table $value");
printf("Truncating $value completed.\n");
}
unset($value);
//get variables from config.sh and defaults.sh
$path = dirname(__FILE__);
$varnames = shell_exec("cat " . $path . "/../config.sh | grep ^export | cut -d \= -f1 | awk '{print $2;}'");
$varnames .= shell_exec("cat " . $path . "/../defaults.sh | grep ^export | cut -d \= -f1 | awk '{print $2;}'");
$vardata = shell_exec("cat " . $path . "/../config.sh | grep ^export | cut -d \\\" -f2 | awk '{print $1;}'");
$vardata .= shell_exec("cat " . $path . "/../defaults.sh | grep ^export | cut -d \\\" -f2 | awk '{print $1;}'");
$varnames = explode("\n", $varnames);
$vardata = explode("\n", $vardata);
$array = array_combine($varnames, $vardata);
unset($array['']);
$TESTING = "{$array['NEWZPATH']}{$array['TESTING_PATH']}";
passthru("cd $TESTING && php spotnab.php -r");
-13
View File
@@ -1,13 +0,0 @@
<?php
require(dirname(__FILE__) . "/../bin/config.php");
require_once(WWW_DIR . "/lib/framework/db.php");
$db = new DB;
$arr = array("parts", "partrepair", "binaries");
foreach ($arr as &$value) {
$rel = $db->query("truncate table $value");
printf("Truncating $value completed.\n");
}
unset($value);