source: remit/util/setup.py @ ff0ea05

client
Last change on this file since ff0ea05 was e5caf62, checked in by Alex Dehnert <adehnert@…>, 15 years ago

Right, shbang lines are useful

  • Property mode set to 100755
File size: 881 bytes
Line 
1#!/usr/bin/python
2import sys
3import os
4
5if __name__ == '__main__':
6    cur_file = os.path.abspath(__file__)
7    django_dir = os.path.abspath(os.path.join(os.path.dirname(cur_file), '..'))
8    sys.path.append(django_dir)
9    os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
10
11import finance_core.models
12import vouchers.models
13
14import util.add_gl_accounts
15import finance_core.util
16
17base_structure = (
18    ('Assets', None, ),
19    ('Expenses', None, ),
20    ('Income', None, ),
21)
22
23if __name__ == '__main__':
24    if len(finance_core.models.BudgetArea.objects.filter(depth=1)) == 0:
25        base = finance_core.models.BudgetArea.add_root(name='Accounts', always=True, use_owner=True, )
26    else:
27        base = finance_core.models.BudgetArea.get_by_path(['Accounts',])
28    finance_core.util.mass_add_accounts(base, base_structure, sys.stdout, )
29    util.add_gl_accounts.add_gl_accounts()
Note: See TracBrowser for help on using the repository browser.