From 08559bff349b8266331389c9a0c579798ce94b4c Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 23 Feb 2009 14:04:50 -0400 Subject: Moved scripts from contrib/scripts/ into contrib/ --- contrib/scripts/README | 4 ---- contrib/scripts/bal | 21 -------------------- contrib/scripts/bal-huquq | 21 -------------------- contrib/scripts/entry | 16 ---------------- contrib/scripts/getquote | 16 ---------------- contrib/scripts/ledger-du | 49 ----------------------------------------------- contrib/scripts/report | 21 -------------------- contrib/scripts/tc | 7 ------- contrib/scripts/ti | 5 ----- contrib/scripts/to | 3 --- contrib/scripts/trend | 30 ----------------------------- 11 files changed, 193 deletions(-) delete mode 100644 contrib/scripts/README delete mode 100755 contrib/scripts/bal delete mode 100755 contrib/scripts/bal-huquq delete mode 100755 contrib/scripts/entry delete mode 100755 contrib/scripts/getquote delete mode 100755 contrib/scripts/ledger-du delete mode 100755 contrib/scripts/report delete mode 100755 contrib/scripts/tc delete mode 100755 contrib/scripts/ti delete mode 100755 contrib/scripts/to delete mode 100755 contrib/scripts/trend (limited to 'contrib/scripts') diff --git a/contrib/scripts/README b/contrib/scripts/README deleted file mode 100644 index 6108afbf..00000000 --- a/contrib/scripts/README +++ /dev/null @@ -1,4 +0,0 @@ -This scripts are provided just to give some ideas. They probably need -to be modified to better suit your environment. Beware! - -John diff --git a/contrib/scripts/bal b/contrib/scripts/bal deleted file mode 100755 index 423e3e41..00000000 --- a/contrib/scripts/bal +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -switch="-c" -limit="-t (/Liabilities/?a<0:Ua>100)&a" - -if [ "$1" = "-C" -o "$1" = "-U" ]; then - switch="$1" - shift -elif [ "$1" = "-b" -o "$1" = "-e" -o "$1" = "-p" ]; then - switch="$1 $2" - shift 2 -fi - -accts="$@" -if [ -z "$accts" ]; then - accts="-Equity -Income -Expenses" -else - limit="" -fi - -ledger -VQ $switch $limit -s -S "-UT" balance $accts diff --git a/contrib/scripts/bal-huquq b/contrib/scripts/bal-huquq deleted file mode 100755 index fad2854a..00000000 --- a/contrib/scripts/bal-huquq +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -switch="-c" -limit="-t (/Liabilities/?(/Huquq/?a/P{2.22AU}<={-1.0}:a<0):Ua>100)&a" - -if [ "$1" = "-C" -o "$1" = "-U" ]; then - switch="$1" - shift -elif [ "$1" = "-b" -o "$1" = "-e" -o "$1" = "-p" ]; then - switch="$1 $2" - shift 2 -fi - -accts="$@" -if [ -z "$accts" ]; then - accts="-Equity -Income -Expenses" -else - limit="" -fi - -ledger -VQ $switch $limit -s -S "-UT" balance $accts diff --git a/contrib/scripts/entry b/contrib/scripts/entry deleted file mode 100755 index cc030d8e..00000000 --- a/contrib/scripts/entry +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -if [ -z "$LEDGER" -o ! -r "$LEDGER" ]; then - echo Please set your LEDGER environment variable. -fi - -line=`wc -l $LEDGER | awk '{print $1}'` - -if ledger entry "$@" > /tmp/entry; then - cat /tmp/entry >> $LEDGER -else - echo "$@" >> $LEDGER -fi -rm /tmp/entry - -vi +$line $LEDGER diff --git a/contrib/scripts/getquote b/contrib/scripts/getquote deleted file mode 100755 index bed561d6..00000000 --- a/contrib/scripts/getquote +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/perl - -$timeout = 60; - -use Finance::Quote; - -$q = Finance::Quote->new; -$q->timeout($timeout); -$q->require_labels(qw/price/); - -%quotes = $q->fetch("nasdaq", $ARGV[0]); -if ($quotes{$ARGV[0], "price"}) { - print "\$", $quotes{$ARGV[0], "price"}, "\n"; -} else { - exit 1; -} diff --git a/contrib/scripts/ledger-du b/contrib/scripts/ledger-du deleted file mode 100755 index f5d7dd7d..00000000 --- a/contrib/scripts/ledger-du +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python - -import string -import sys -import os -import time - -from stat import * -from os.path import * - -def report_file(path): - dir_elems = string.split(dirname(path), os.sep) - if dir_elems[0] == "." or dir_elems[0] == "": - dir_elems = dir_elems[1 :] - account = string.join(dir_elems, ":") - - info = os.stat(path) - print time.strftime("%Y/%m/%d", time.localtime(info[ST_MTIME])), - - print basename(path) - print " ", account, " ", info[ST_SIZE], "b" - print " Equity:Files" - print - -def find_files(path): - entries = os.listdir(path) - for entry in entries: - entry = join(path, entry) - if not islink(entry): - if isdir(entry) and entry != "/proc": - find_files(entry) - else: - report_file(entry) - -args = sys.argv[1:] -if len(args): - paths = args -else: - paths = ["."] - -print """ -C 1.00 Kb = 1024 b -C 1.00 Mb = 1024 Kb -C 1.00 Gb = 1024 Mb -C 1.00 Tb = 1024 Gb -""" - -for path in paths: - find_files(path) diff --git a/contrib/scripts/report b/contrib/scripts/report deleted file mode 100755 index 24418cdc..00000000 --- a/contrib/scripts/report +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -# This script facilities plotting of a ledger register report. If you -# use OS/X, and have AquaTerm installed, you will probably want to set -# LEDGER_TERM to "aqua". -# -# Examples of use: -# -# report -j -M reg food # plot monthly food costs -# report -J reg checking # plot checking account balance - -if [ -z "$LEDGER_TERM" ]; then - LEDGER_TERM="x11 persist" -fi - -(cat <