Beispiel #1
0
def main():
	args = parse_args()
	gcf = open_gcf(args.gnucash_file, scheme)
	book = gcf.book
	ac = book.ac_by_path(args.account)
	for mut in ac.get_descendants_mutations():
		print repr(mut)
Beispiel #2
0
	def main(self):
		self.gcf = open_gcf(self.args.gnucash_file, scheme)
		self.book = self.gcf.book
		for kind in Softref.kinds:
			self.print_by_kind(kind)
			print ""
			print ""
Beispiel #3
0
def main():
    if len(sys.argv) != 3:
        print("Please provide (1) a path to the gnucash file"
              " and (2) a path to another gnucash file"
              " to compare it with.")
        return

    cmd, path_a, path_b = sys.argv

    print("Comparing:")
    print(" A. %s  with " % (path_a,))
    print(" B. %s ;" % (path_b,))
    print("")
    if not os.path.exists(path_a):
        print("File A does not exist")
        return
    if not os.path.exists(path_b):
        print("File B does not exist")
        return

    print("Loading A...  this may take a while...")
    A = open_gcf(path_a, scheme)
    print("done.")
    print("")
    print("Loading B...")
    B = open_gcf(path_b, scheme)
    print("done.")
    print("")

    print("Computing difference...")
    print("   '-x' means x is in A, but not B; it has been removed")
    print("   '+x' means x is in B, but not A; it has been added")
    print("   '~x' means x has been changed; the difference follows in ( )")
    print("")
    print(GcStructDiff(A, B))
    print("")
    print("done.")
Beispiel #4
0
def main(argv):
    path = " ".join(argv[1:]).strip()
    if not path:
        print "please provide a path to a gnucash file as argument."
        return
    gcf = open_gcf(path, scheme)
    book = gcf.fields["books"].values()[0]
    v = Verifier(gcf)
    res = v.verify(
        TrsHaveNum, TrNumsAreWellFormed, TrNumsAreContinuous, AcMutThenNoSplit, TrMutAc, SpNonZero, TrHaveFin7Softref
    )
    for fact in res:
        print fact
        print res[fact]
        print ""
Beispiel #5
0
def main():
    args = parse_args()
    gcf = open_gcf(args.gnucash_file)
    book = gcf.fields['books'].values()[0]

    if args.name is not None:
        print(get_user_balance(
            book,
            args.creditors_account + ":" + args.name,
            args.debitors_account + ":" + args.name
        )['mutations'])
    else:
        print(get_debitors(
            book,
            args.creditors_account,
            args.debitors_account
        ))