mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Merge Christoph Holtermann's 'PR-python2to3' into maint.
This commit is contained in:
commit
8823f7283f
@ -117,7 +117,7 @@ def next_period_start(start_year, start_month, period_type):
|
||||
def period_end(start_year, start_month, period_type):
|
||||
if period_type not in PERIODS:
|
||||
raise Exception("%s is not a valid period, should be %s" % (
|
||||
period_type, str(PERIODS.keys()) ) )
|
||||
period_type, str(list(PERIODS.keys())) ) )
|
||||
|
||||
end_year, end_month = next_period_start(start_year, start_month,
|
||||
period_type)
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/python
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: UTF-8 -*-
|
||||
|
||||
##@file
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
##@file
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# new_book_with_opening_balances.py -- Replicate the account structure of a
|
||||
# book and apply basis opening balances from the original
|
||||
@ -334,7 +334,7 @@ def main():
|
||||
simple_opening_name_used = False
|
||||
|
||||
for (namespace, mnemonic), (opening_trans, opening_amount) in \
|
||||
opening_balance_per_currency.iteritems() :
|
||||
opening_balance_per_currency.items() :
|
||||
simple_opening_name_used = create_opening_balance_transaction(
|
||||
commodtable, namespace, mnemonic,
|
||||
new_book_root, new_book,
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
# Test file for price database stuff
|
||||
# To update the price database call
|
||||
# $PATH/gnucash --add-price-quotes $PATHTOFILE
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
# Another test file for price database stuff
|
||||
# To update the price database call
|
||||
# $PATH/gnucash --add-price-quotes $PATHTOFILE
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# quotes_historic.py -- Example Script to read historic quote data into gnucash
|
||||
#
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
'''
|
||||
|
||||
@ -843,7 +843,7 @@ def getSubAccounts(account):
|
||||
|
||||
flat_accounts = []
|
||||
|
||||
if 'subaccounts' in account.keys():
|
||||
if 'subaccounts' in list(account.keys()):
|
||||
for n, subaccount in enumerate(account['subaccounts']):
|
||||
flat_accounts.append(subaccount)
|
||||
flat_accounts = flat_accounts + getSubAccounts(subaccount)
|
||||
@ -1824,7 +1824,7 @@ def gnc_numeric_from_decimal(decimal_value):
|
||||
numerator_place_value = 1
|
||||
# add each digit to the final value multiplied by the place value
|
||||
# from least significant to most sigificant
|
||||
for i in xrange(len(digits)-1,-1,-1):
|
||||
for i in range(len(digits)-1,-1,-1):
|
||||
numerator += digits[i] * numerator_place_value
|
||||
numerator_place_value *= TEN
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
## @file
|
||||
# @brief Simple example for a book
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# simple_business_create.py -- Set up a set of books for business feature use
|
||||
#
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# simple_invoice_insert.py -- Add an invoice to a set of books
|
||||
#
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
## @file
|
||||
# @brief Example Script simple session
|
||||
# @ingroup python_bindings_examples
|
||||
@ -14,7 +14,7 @@ FILE_2 = "/tmp/example_file.xac"
|
||||
session = None
|
||||
try:
|
||||
session = Session(FILE_1)
|
||||
except GnuCashBackendException, backend_exception:
|
||||
except GnuCashBackendException as backend_exception:
|
||||
assert( ERR_FILEIO_FILE_NOT_FOUND in backend_exception.errors)
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ session.destroy()
|
||||
session = Session(FILE_2)
|
||||
try:
|
||||
session_2 = Session(FILE_2)
|
||||
except GnuCashBackendException, backend_exception:
|
||||
except GnuCashBackendException as backend_exception:
|
||||
assert( ERR_BACKEND_LOCKED in backend_exception.errors )
|
||||
session.end()
|
||||
session.destroy()
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
## @file
|
||||
# @brief Example Script simple sqlite create
|
||||
# @ingroup python_bindings_examples
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
## @file
|
||||
# @brief Creates a basic set of accounts and a couple of transactions
|
||||
# @ingroup python_bindings_examples
|
||||
|
Loading…
Reference in New Issue
Block a user