pax_global_header00006660000000000000000000000064143423522040014511gustar00rootroot0000000000000052 comment=48ba347b3a81b8759850e5b45ffff4bb91c03bce ledgerhelpers-0.3.10/000077500000000000000000000000001434235220400144175ustar00rootroot00000000000000ledgerhelpers-0.3.10/.github/000077500000000000000000000000001434235220400157575ustar00rootroot00000000000000ledgerhelpers-0.3.10/.github/workflows/000077500000000000000000000000001434235220400200145ustar00rootroot00000000000000ledgerhelpers-0.3.10/.github/workflows/test.yml000066400000000000000000000015561434235220400215250ustar00rootroot00000000000000name: Test on: [push, pull_request] jobs: test: runs-on: ubuntu-22.04 strategy: matrix: python-version: ["3.10"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | set -e # sudo add-apt-repository universe # sudo apt-cache policy sudo apt-get install -y python3-ledger tox python3-pytest gobject-introspection # Needed to allow Tox to run in the current env. # Current env necessary because we are installing GTK+ and other # libraries needed for the programs. pip3 install tox-current-env - name: Run tests run: | # pylint $(git ls-files '*.py') tox --current-env -v ledgerhelpers-0.3.10/.gitignore000066400000000000000000000000701434235220400164040ustar00rootroot00000000000000*.pyc *~ dist *.egg-info build .settings *.tar.gz *.rpm ledgerhelpers-0.3.10/.project000066400000000000000000000005571434235220400160750ustar00rootroot00000000000000 ledgerhelpers org.python.pydev.PyDevBuilder org.python.pydev.pythonNature ledgerhelpers-0.3.10/.pydevproject000066400000000000000000000006651434235220400171450ustar00rootroot00000000000000 /${PROJECT_DIR_NAME}/src python 3.7 System Python 3.7 ledgerhelpers-0.3.10/Jenkinsfile000066400000000000000000000002361434235220400166040ustar00rootroot00000000000000// https://github.com/Rudd-O/shared-jenkins-libraries @Library('shared-jenkins-libraries@master') _ genericFedoraRPMPipeline(null, null, ['python3-ledger']) ledgerhelpers-0.3.10/LICENSE.txt000066400000000000000000000432541434235220400162520ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. ledgerhelpers-0.3.10/MANIFEST.in000066400000000000000000000003521434235220400161550ustar00rootroot00000000000000include README.md include doc/* include applications/*.desktop include tests/*py include tests/testdata/* include tests/dogtail/*.py include *.spec include tox.ini include Jenkinsfile include build.parameters global-exclude *.py[cod] ledgerhelpers-0.3.10/README.md000066400000000000000000000071531434235220400157040ustar00rootroot00000000000000Ledger helpers (ledgerhelpers) ============================ This is a collection of small single-purpose programs to aid your accounting with [Ledger](https://github.com/ledger/ledger) (ledger-cli). Think of it as the batteries that were never included with Ledger. Why should you use them? Because: * All the ledgerhelpers have been designed with fast data entry in mind, and they will remember or evoke existing data as needed, to help you minimize typing and other drudgery. * They all have launcher icons in your desktop environment -- this makes it very easy to add icons or shortcuts for them, so you can run them on the spot. This package also contains a library with common functions that you can use in your project to make it easier to develop software compatible with Ledger. What can you do with these programs ----------------------------------- * Enter transactions easily with [addtrans](https://github.com/Rudd-O/ledgerhelpers/blob/master/bin/addtrans). * Update your price quotes with [updateprices](https://github.com/Rudd-O/ledgerhelpers/blob/master/bin/updateprices). * Record multi-currency ATM withdrawals with [withdraw-cli](https://github.com/Rudd-O/ledgerhelpers/blob/master/bin/withdraw-cli). * Record FIFO stock or commodity sales with [sellstock-cli](https://github.com/Rudd-O/ledgerhelpers/blob/master/bin/sellstock-cli). * Interactively clear transactions with [cleartrans-cli](https://github.com/Rudd-O/ledgerhelpers/blob/master/bin/cleartrans-cli). * Keep your ledger chronologically sorted with [sorttrans-cli](https://github.com/Rudd-O/ledgerhelpers/blob/master/bin/sorttrans-cli). Usage and manuals ----------------- * [How to add transactions with `addtrans`](doc/addtrans.md) See also individual [manual pages](man/) in NROFF format. How to download and install --------------------------- Here are instructions to install the very latest iteration of ledgerhelpers: If you are on a Linux system and want to install it as an RPM package: * Obtain the package with `git clone https://github.com/Rudd-O/ledgerhelpers` * Change to the directory `cd ledgerhelpers` * Create a source package with `python3 -m build --sdist` * Create a source RPM with `rpmbuild --define "_srcrpmdir ./" --define "_sourcedir dist/" -bs *.spec` * You may need to install some dependencies at this point. The process will tell you. * Create an installable RPM with `rpmbuild --rebuild --nodeps --define "_rpmdir ./" *.src.rpm` * You may need to install some dependencies at this point. The process will tell you. * Install the package with `sudo rpm -Uvh noarch/*.noarch.rpm` In other circumstances or Linux systems: * Obtain the package with `git clone https://github.com/Rudd-O/ledgerhelpers` * Change to the directory `cd ledgerhelpers` * Create the source package directly with `python3 -m build --sdist` * Install the package (to your user directory `~/.local`) with `pip3 install dist/*.tar.gz` * This will install a number of dependencies for you. Your system should already have the GTK+ 3 library and the Python GObject introspection library. The programs in `bin/` can generally run from the source directory, provided that the PYTHONPATH points to the `src/` folder inside the source directory, but you still need to install the right dependencies, such as GTK+ 3 or later, and the Python GObject introspection library. License ------- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. See [full license terms](LICENSE.txt). ledgerhelpers-0.3.10/TODO000066400000000000000000000007541434235220400151150ustar00rootroot00000000000000* merge alignpostings from financial machine as alignpostings-cli * rename sortpostigns to sortpostings-cli * enhance parser so that sortpostings-cli and alignpostings-cli can use the parser instead of regexps instead * add tests for sortpostings-cli and alignpostings-cli * make parsegmob output the transactions where the a/r accrual happens * figure out where to store bal, reg, and parsegmob, and parsemypay somewhere perhaps they should be more than just scripts in the financial vm ledgerhelpers-0.3.10/applications/000077500000000000000000000000001434235220400171055ustar00rootroot00000000000000ledgerhelpers-0.3.10/applications/addtrans.desktop000066400000000000000000000002751434235220400223040ustar00rootroot00000000000000[Desktop Entry] Name=Record transaction Exec=addtrans Icon=application-x-executable Terminal=false TryExec=addtrans Type=Application Categories=Office;Finance; X-AppInstall-Keywords=ledger ledgerhelpers-0.3.10/applications/cleartrans-cli.desktop000066400000000000000000000003301434235220400233770ustar00rootroot00000000000000[Desktop Entry] Name=Clear uncleared transactions (CLI) Exec=cleartrans-cli Icon=application-x-executable Terminal=true TryExec=cleartrans-cli Type=Application Categories=Office;Finance; X-AppInstall-Keywords=ledger ledgerhelpers-0.3.10/applications/sellstock-cli.desktop000066400000000000000000000003131434235220400232450ustar00rootroot00000000000000[Desktop Entry] Name=Record stock sale (CLI) Exec=sellstock-cli Icon=application-x-executable Terminal=true TryExec=sellstock-cli Type=Application Categories=Office;Finance; X-AppInstall-Keywords=ledger ledgerhelpers-0.3.10/applications/sorttrans-cli.desktop000066400000000000000000000003131434235220400233010ustar00rootroot00000000000000[Desktop Entry] Name=Sort transactions (CLI) Exec=sorttrans-cli Icon=application-x-executable Terminal=true TryExec=sorttrans-cli Type=Application Categories=Office;Finance; X-AppInstall-Keywords=ledger ledgerhelpers-0.3.10/applications/updateprices.desktop000066400000000000000000000003041434235220400231650ustar00rootroot00000000000000[Desktop Entry] Name=Update price file Exec=updateprices Icon=application-x-executable Terminal=false TryExec=updateprices Type=Application Categories=Office;Finance; X-AppInstall-Keywords=ledger ledgerhelpers-0.3.10/applications/withdraw-cli.desktop000066400000000000000000000003111434235220400230710ustar00rootroot00000000000000[Desktop Entry] Name=Record withdrawal (CLI) Exec=withdraw-cli Icon=application-x-executable Terminal=true TryExec=withdraw-cli Type=Application Categories=Office;Finance; X-AppInstall-Keywords=ledger ledgerhelpers-0.3.10/bin/000077500000000000000000000000001434235220400151675ustar00rootroot00000000000000ledgerhelpers-0.3.10/bin/addtrans000077500000000000000000000003611434235220400167150ustar00rootroot00000000000000#!/usr/bin/python3 # -*- coding: utf-8 -*- import os import sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src")) from ledgerhelpers.programs import addtrans if __name__ == "__main__": sys.exit(addtrans.main()) ledgerhelpers-0.3.10/bin/cleartrans-cli000077500000000000000000000003701434235220400200200ustar00rootroot00000000000000#!/usr/bin/python2 # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), "..", "src")) from ledgerhelpers.programs import cleartranscli if __name__ == "__main__": sys.exit(cleartranscli.main()) ledgerhelpers-0.3.10/bin/sellstock-cli000077500000000000000000000003711434235220400176660ustar00rootroot00000000000000#!/usr/bin/python2 # -*- coding: utf-8 -*- import os import sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src")) from ledgerhelpers.programs import sellstockcli if __name__ == "__main__": sys.exit(sellstockcli.main()) ledgerhelpers-0.3.10/bin/sorttrans-cli000077500000000000000000000004011434235220400177140ustar00rootroot00000000000000#!/usr/bin/python3 # -*- coding: utf-8 -*- import os import sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src")) from ledgerhelpers.programs import sorttranscli if __name__ == "__main__": sys.exit(sorttranscli.main(sys.argv)) ledgerhelpers-0.3.10/bin/updateprices000077500000000000000000000004011434235220400176000ustar00rootroot00000000000000#!/usr/bin/python2 # -*- coding: utf-8 -*- import os import sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src")) from ledgerhelpers.programs import updateprices if __name__ == "__main__": sys.exit(updateprices.main(sys.argv)) ledgerhelpers-0.3.10/bin/withdraw-cli000077500000000000000000000003641434235220400175160ustar00rootroot00000000000000#!/usr/bin/python2 # -*- coding: utf-8 -*- import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), "..", "src")) from ledgerhelpers.programs import withdrawcli if __name__ == "__main__": sys.exit(withdrawcli.main()) ledgerhelpers-0.3.10/build.parameters000066400000000000000000000000221434235220400175750ustar00rootroot00000000000000["RELEASE": "36"] ledgerhelpers-0.3.10/doc/000077500000000000000000000000001434235220400151645ustar00rootroot00000000000000ledgerhelpers-0.3.10/doc/addtrans-account.png000066400000000000000000000772011434235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a(ݡlvGCi[S-@t-@t-@tKU t,8@#r=ptY@V|ϟX;[縨@痛䧾ihTX| <-fDb5zگ};{ -[O<7~/}ΩIrs4-aDl-5vݒH2CSR܇hz>ŘVn=TdU| R[PD.*IS -tA3 œWn1WtkQ>b@{"|2VS ޱcK`:7+oU< YY t*TJ S]Y+̅ Z.,`u]+zC\~/\} *EZI 3B_}hiְ2cPUk # ;toIENDB`ledgerhelpers-0.3.10/doc/addtrans.md000066400000000000000000000202751434235220400173140ustar00rootroot00000000000000`addtrans`: add transactions fast ================================= This program helps you enter new transactions as fast as possible. With as little as two or three keystrokes (one for autocompletion, zero or one for date change, and one for confirmation), you can have a correct transaction entered into your ledger. This is how `addtrans` assists you: * autocompletion of old transactions based on the payee / description, * autocompletion of existing accounts as you type, * intelligent currency detection for amounts, based on the last currency used for the account associated with the amount, * intelligent memory of the last dates used for a transaction, * extensive keyboard shortcuts, both to focus on fields and to alter unfocused fields (see below for details). We'll quickly show you how you can take advantage of `addtrans` in a few screenshots and words. Entering data with `addtrans`: a quick tutorial ----------------------------------------------- After you install the program onto your system, you can simply run the *Add transaction* program under your desktop's program menu. The program will appear like this: ![Add transaction running](addtrans-started-up.png?raw=true "Add transaction running") At this point you are ready to begin typing the payee or the description of a transaction. As you type, a dropdown with all matching transactions will appear, and the closest match will be used as a model for the transaction you are about to enter. You can ignore the dropdown and continue typing, or simply select one from the dropdown and then hit *Enter*. Note how the preview field below shows you the transaction as it will be entered at the end of your ledger. This lets you have 100% confidence that what you see is what you will get. This is how the process looks like (minus the dropdown, as my desktop environment does not let me capture transient windows here): ![Add transaction typeahed search](addtrans-dropdown.png?raw=true "Add transaction typeahead search") Don't worry too much about this. It's pretty intuitive. Anything that matches a previous transaction gets automatically entered as the transaction you are about to enter. As long as you have not yet altered the account and amount entries below, this autocomplete will replace the entire transaction as you edit it. At this point, you might want to set the right dates (main and / or auxiliary) on the transaction you are entering. Suppose you want to backtrack three days from today. There are a number of ways to do so: 1. You can click on the calendar icon next to the date you want to change, then select the date and confirming. 2. You can switch to the respective date entry with the shortcut key associated with the entry (see below), then type the date. 3. You can simply use the appropriate general shortcut key three times to backtrack the date three days (Control+Minus, see below for full reference). We'll choose option 3 for speed. After the main date has gone back 3 days, note that the keyboard focus remains on the *Payee* field. This is excellent — you invested very little effort, and you already have an almost fully finished transaction, with very few changes that need to be made. Now you are ready to finish the rest of the transaction. Again, simple. Tab your way out of the *Payee* field and into the first amount, then enter the amount and the first account on the line below: ![Add transaction add amount](addtrans-amount.png?raw=true "Add transaction add amount") Note that you can specify any currencies there, but *you don't have to*. If you do not, `addtrans` will recall the last currency you used for the corresponding account, then use that currency. What this means is that, in practice, 99% of the transactions you enter will never require you to type any currency. Tab yourself out of the amount field, and enter an account. We'll change the asset account to a different one: ![Add transaction account entry](addtrans-account.png?raw=true "Add transaction account entry") Note that autocomplete works for us here. Either enter your full account, or select the account from the autocomplete suggestions. Remember that you can use either the mouse or the arrow keys and *Enter* to choose an option. Follow the same process for the rest of the records of the transaction, then hit *Add* to record the entire transaction on your ledger. Note that you can also hit *Enter* at any point and, if the transaction is valid, it will be recorded. After recording a transaction, `addtrans` will leave you ready to enter further transactions: ![Add transaction ready for more](addtrans-readyagain.png?raw=true "Add transaction ready for more") Things to note: * Just as ledger normally allows, you do not need to enter an amount on the last record of the transaction. As long as all but one of your records has an amount, `addtrans` is good with you. * Adding amounts with currency equivalencies (`xxx CUR1 @ yyy CUR2`) works as you would expect of any ledger entry. * `addtrans` will note any validation errors on its status line next to the action buttons at the bottom. Note that there is a limitation in ledger (a bug that has been fixed, but whose fix has not been released) that prevents `addtrans` from telling you exactly what's wrong with the transaction, but we're confident at this time that the bug fix will be released soon. In the meantime, use the transaction preview as a guide to understand what might be wrong. * You can learn to enter transactions at amazing speed and with very little effort. See below for very useful key combinations to help you enter data extremely fast. Thus, we come to the end of the quick tutorial. How to get to `addtrans` really fast ------------------------------------ `addtrans` starts really quickly, and it's very convenient to come back to your laptop or workstation after an expense to enter it right away. So we recommend you add a global keyboard shortcut on your desktop environment, such that `addtrans` can be started with a single key. Instructions vary from environment to environment: * KDE: use the `kmenuedit` program: * Right-click on the Application Menu of your desktop. * Select *Edit Applications...*. * Find and select the menu entry for *Add transaction* (usually under the *Financial* category). * Move to the *Advanced* tab on the right-side menu entry pane. * Click on the button next to the *Current shortcut key*. * Tap on the key you want to use to launch the program. * Exit the menu editor, saving the changes you just made. Key combinations and other tricks for fast data entry ----------------------------------------------------- Key combos: * General: * Alt+C: close window without saving * Enter: save transaction as displayed in the preview * Alt+A: save transaction as displayed in the preview * Tab: go to the next field or control * Shift+Tab: go to the previous field or control * While any of the entry fields is focused: * Arrow Up: focus on the field right above the one with focus. * Arrow Down: focus on the field right below the one with focus. * Alt+T: focus on the main date * Alt+L: focus on the auxiliary date * Alt+P: focus on the payee / description field * Control+Minus: previous day on the main date * Control+Plus: next day on the main date * Control+Page Up: same day previous month on the main date * Control+Plus Down: same day next month on the main date * Shift+Control+Minus: previous day on the auxiliary date * Shift+Control+Plus: next day on the auxiliary date * Shift+Control+Page Up: same day previous month on the auxiliary date * Shift+Control+Plus Down: same day next month on the auxiliary date * While any of the date fields is focused: * Minus / Underscore: previous day * Plus / Equals: next day * Page Up: same day previous month * Page Down: same day next month * Home: beginning of month * End: end of month * Alt+Down: drop down a calendar picker * While the calendar picker of one of the dates is focused: * Same control keys for date selection * Arrow keys: move around the calendar * Space: select the day framed by the dotted line * Enter: confirm and closes the popup * Alt+Up: hide the calendar picker * While the transaction state button is focused: * Space: cycle through the different states ledgerhelpers-0.3.10/ledgerhelpers.spec000066400000000000000000000031431434235220400201210ustar00rootroot00000000000000# See https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_example_spec_file %define debug_package %{nil} %define _name ledgerhelpers %define mybuildnumber %{?build_number}%{?!build_number:1} Name: python-%{_name} Version: 0.3.10 Release: %{mybuildnumber}%{?dist} Summary: A collection of helper programs and a helper library for Ledger (ledger-cli) License: GPLv2+ URL: https://github.com/Rudd-O/%{_name} Source: %{url}/archive/v%{version}/%{_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel %global _description %{expand: This is a collection of small single-purpose programs to aid your accounting with [Ledger](https://github.com/ledger/ledger) (ledger-cli). Think of it as the batteries that were never included with Ledger.} %description %_description %package -n %{_name} Summary: %{summary} %description -n %{_name} %_description %prep %autosetup -p1 -n %{_name}-%{version} %generate_buildrequires %pyproject_buildrequires -t %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{_name} %check %tox # Note that there is no %%files section for # the unversioned python module, python-pello. # For python3-pello, %%{pyproject_files} handles code files and %%license, # but executables and documentation must be listed in the spec file: %files -n %{_name} -f %{pyproject_files} %attr(0755, -, -) %{_bindir}/* %{_mandir}/man1/* %{_datadir}/applications/* %doc README.md doc/* %changelog * Thu Jun 16 2022 Manuel Amador 0.1.0-1 - First RPM packaging release ledgerhelpers-0.3.10/man/000077500000000000000000000000001434235220400151725ustar00rootroot00000000000000ledgerhelpers-0.3.10/man/addtrans.1000066400000000000000000000044741434235220400170650ustar00rootroot00000000000000.\" Hey, EMACS: -*- nroff -*- .\" (C) Copyright 2022 Marcin Owsiany , .\" .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH addtrans 1 "November 11 2022" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME addtrans \- interactively add transactions to a ledger file .SH SYNOPSIS .B addtrans .RI [ options ] .SH DESCRIPTION .B addtrans is a graphical application for quickly adding new transactions to a ledger file. .PP A tutorial for using this program, with screenshots, is available at .BR /usr/share/doc/ledgerhelpers/doc/addtrans.html .PP The program must be supplied with locations of the ledger and price database files to work with. The location of each file is determined independently, using the following mechanisms, in this order. The first mechanism which yields a result, wins. .SH OPTIONS .TP .BR \-h , .BR \-\-help Show help message and exit. .TP .B \-\-file FILE Specify path to ledger file to work with. .TP .B \-\-price\-db PRICEDB Specify path to ledger price database to work with. .TP .B \-\-debug Turn on debugging output, may be useful for developers. .SH ENVIRONMENT The following environment variables are recognized by this program: .TP .BR LEDGER_FILE Path to ledger file to work with. .TP .BR LEDGER_PRICE_DB Path to ledger price database to work with. .SH FILES The config file for .BR ledger (1), namely file .BR .ledgerrc in user's home directory is scanned looking for the following options. .TP .B \-\-file FILE Path to ledger file to work with. .TP .B \-\-price\-db PRICEDB Path to ledger price database to work with. .SH SEE ALSO .BR ledger (1), .BR cleartrans\-cli (1), .BR sellstock\-cli (1), .BR sorttrans\-cli (1), .BR withdraw\-cli (1). .br A tutorial for using this program, with screenshots, is available at .BR /usr/share/doc/ledgerhelpers/doc/addtrans.html ledgerhelpers-0.3.10/man/cleartrans-cli.1000066400000000000000000000037561434235220400201720ustar00rootroot00000000000000.\" Hey, EMACS: -*- nroff -*- .\" (C) Copyright 2022 Marcin Owsiany , .\" .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH cleartrans\-cli 1 "November 11 2022" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME cleartrans\-cli \- interactively clear transactions in a ledger file .SH SYNOPSIS .B cleartrans .SH DESCRIPTION .B cleartrans\-cli is a text program for quickly clearing transactions in a ledger file. .PP This program looks for all uncleared transactions in the ledger file, whose effective date is not in the future. For each such transaction, it asks whether the transaction should be cleared, and prompts for an effective date for the transaction. .PP The resulting ledger is written to a new file, and atomically renamed to the original filename. This prevents accidental loss of data. .PP The program must be supplied with location of the ledger file to work with. The location of the file is determined using the following mechanisms, in this order. The first mechanism which yields a result, wins. .SH ENVIRONMENT The following environment variable is recognized by this program: .TP .BR LEDGER_FILE Path to ledger file to work with. .SH FILES The config file for .BR ledger (1), namely file .BR .ledgerrc in user's home directory is scanned looking for the following option. .TP .B \-\-file FILE Path to ledger file to work with. .SH SEE ALSO .BR ledger (1), .BR addtrans (1), .BR sellstock\-cli (1), .BR sorttrans\-cli (1), .BR withdraw\-cli (1). ledgerhelpers-0.3.10/man/sellstock-cli.1000066400000000000000000000041501434235220400200240ustar00rootroot00000000000000.\" Hey, EMACS: -*- nroff -*- .\" (C) Copyright 2022 Marcin Owsiany , .\" .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH sellstock\-cli 1 "November 14 2022" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME sellstock\-cli \- record FIFO stock or commodity sales .SH SYNOPSIS .B sellstock\-cli .SH DESCRIPTION .B sellstock\-cli is a text program for quickly recording commodity sales in a ledger file. .PP The program first prompts for the account in which the commodity was stored, the account for commissions, and the account to credit for gains and losses, as well as the amount and name of sold commodity, its sale price, and the commission. .PP Then the program invokes .B ledger to list the dates and prices at which each commodity was purchased, lists them, subtracts the requested amount and shows the result. .PP Finally, the resulting transaction is shown, asking for a confirmation to save it to the journal. .PP The program must be supplied with location of the ledger file to work with. The location of the file is determined using the following mechanisms, in this order. The first mechanism which yields a result, wins. .SH ENVIRONMENT The following environment variable is recognized by this program: .TP .BR LEDGER_FILE Path to ledger file to work with. .SH FILES The config file for .BR ledger (1), namely file .B .ledgerrc in user's home directory is scanned looking for the following option. .TP .B \-\-file FILE Path to ledger file to work with. .SH SEE ALSO .BR ledger (1), .BR addtrans (1), .BR cleartrans\-cli (1), .BR sorttrans\-cli (1), .BR withdraw\-cli (1). ledgerhelpers-0.3.10/man/sorttrans-cli.1000066400000000000000000000044341434235220400200650ustar00rootroot00000000000000.\" Hey, EMACS: -*- nroff -*- .\" (C) Copyright 2022 Marcin Owsiany , .\" .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH sorttrans\-cli 1 "November 14 2022" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME sorttrans\-cli \- sorts a ledger file in chronological order .SH SYNOPSIS .B sorttrans\-cli .RI [ options ] .SH OPTIONS .TP .BR -y Write back the file immediately, without showing the differences. .TP .BR \-h , .BR \-\-help Show help message and exit. .TP .B \-\-file FILE Specify path to ledger file to work with. .TP .B \-\-price\-db PRICEDB Specify path to ledger price database to work with. .TP .B \-\-debug Turn on debugging output, may be useful for developers. . .SH DESCRIPTION .B sorttrans\-cli is a text program for sorting a ledger in chronological order. .PP The program loads the ledger file and sorts the transactions in memory. Then, depending on the command-line options, it either writes the sorted file back, or invokes .B meld with the original and sorted version shown, for interactive editing. .PP The program must be supplied with location of the ledger file to work with. If not supplied using the command-line option .BR \-\-file , the location of the file is determined using the following mechanisms, in this order. The first mechanism which yields a result, wins. .SH ENVIRONMENT The following environment variable is recognized by this program: .TP .BR LEDGER_FILE Path to ledger file to work with. .SH FILES The config file for .BR ledger (1), namely file .B .ledgerrc in user's home directory is scanned looking for the following option. .TP .B \-\-file FILE Path to ledger file to work with. .SH SEE ALSO .BR ledger (1), .BR meld (1), .BR addtrans (1), .BR cleartrans\-cli (1), .BR sellstock\-cli (1), .BR withdraw\-cli (1). ledgerhelpers-0.3.10/man/withdraw-cli.1000066400000000000000000000034141434235220400176540ustar00rootroot00000000000000.\" Hey, EMACS: -*- nroff -*- .\" (C) Copyright 2022 Marcin Owsiany , .\" .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH withdraw\-cli 1 "November 11 2022" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME withdraw\-cli \- record multi-currency ATM withdrawals in a ledger file .SH SYNOPSIS .B withdraw .SH DESCRIPTION .B withdraw\-cli is a text program for quickly entering cash withdrawal transactions in a ledger file. .PP This program interactively asks for accounts and withdrawn and deposited amounts, and adds a transaction to the ledger file after confirmation. .PP The program must be supplied with location of the ledger file to work with. The location of the file is determined using the following mechanisms, in this order. The first mechanism which yields a result, wins. .SH ENVIRONMENT The following environment variable is recognized by this program: .TP .BR LEDGER_FILE Path to ledger file to work with. .SH FILES The config file for .BR ledger (1), namely file .BR .ledgerrc in user's home directory is scanned looking for the following option. .TP .B \-\-file FILE Path to ledger file to work with. .SH SEE ALSO .BR ledger (1), .BR addtrans (1), .BR cleartrans\-cli (1), .BR sellstock\-cli (1), .BR sorttrans\-cli (1). ledgerhelpers-0.3.10/pyproject.toml000066400000000000000000000001251434235220400173310ustar00rootroot00000000000000[build-system] requires = ["setuptools>=42"] build-backend = "setuptools.build_meta" ledgerhelpers-0.3.10/setup.cfg000066400000000000000000000032301434235220400162360ustar00rootroot00000000000000[metadata] name = ledgerhelpers version = attr: ledgerhelpers.__version__ author = Manuel Amador (Rudd-O) author_email = rudd-o@rudd-o.com description = A collection of helper programs and a helper library for Ledger (ledger-cli) long_description = file: README.md long_description_content_type = text/markdown url = https://github.com/Rudd-O/ledgerhelpers classifiers = Development Status :: 4 - Beta Environment :: X11 Applications :: GTK Intended Audience :: End Users/Desktop License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+) Operating System :: POSIX :: Linux Programming Language :: Python :: 3 :: Only Programming Language :: Python :: 3.6 Topic :: Office/Business :: Financial :: Accounting license = GPLv2+ [options] include_package_data = True install_requires = PyGObject ledger yahoo-finance package_dir = = src packages = find: scripts = bin/addtrans bin/cleartrans-cli bin/sellstock-cli bin/sorttrans-cli bin/updateprices bin/withdraw-cli [options.data_files] share/applications = applications/withdraw-cli.desktop applications/cleartrans-cli.desktop applications/sorttrans-cli.desktop applications/updateprices.desktop applications/sellstock-cli.desktop applications/addtrans.desktop share/doc/ledgerhelpers = doc/addtrans.md doc/addtrans-account.png doc/addtrans-amount.png doc/addtrans-dropdown.png doc/addtrans-readyagain.png doc/addtrans-started-up.png share/man/man1 = man/addtrans.1 man/cleartrans-cli.1 man/sellstock-cli.1 man/sorttrans-cli.1 man/withdraw-cli.1 [options.packages.find] where = src ledgerhelpers-0.3.10/src/000077500000000000000000000000001434235220400152065ustar00rootroot00000000000000ledgerhelpers-0.3.10/src/ledgerhelpers/000077500000000000000000000000001434235220400200335ustar00rootroot00000000000000ledgerhelpers-0.3.10/src/ledgerhelpers/__init__.py000077500000000000000000000162071434235220400221550ustar00rootroot00000000000000#!/usr/bin/python3 import pickle import calendar import codecs import collections import datetime import fcntl import fnmatch import logging import re import os import signal import struct import sys import termios import threading import time import tty __version__ = "0.3.10" log = logging.getLogger(__name__) def debug(string, *args): log.debug(string, *args) _debug_time = False def debug_time(logger): def debug_time_inner(kallable): def f(*a, **kw): global _debug_time if not _debug_time: return kallable(*a, **kw) start = time.time() try: name = kallable.__name__ except AttributeError: name = str(kallable) name = name + "@" + threading.currentThread().getName() try: logger.debug("* Timing: %-55s started", name) return kallable(*a, **kw) finally: end = time.time() - start logger.debug("* Timed: %-55s %.3f seconds", name, end) return f return debug_time_inner def enable_debugging(enable): global _debug_time if enable: _debug_time = True fmt = "%(created)f:%(levelname)8s:%(name)20s: %(message)s" logging.basicConfig(level=logging.DEBUG, format=fmt) def matches(string, options): """Returns True if the string case-insensitively glob-matches any of the globs present in options.""" for option in options: if fnmatch.fnmatch(string, option): return True return False class LedgerConfigurationError(Exception): pass class TransactionInputValidationError(ValueError): pass def find_ledger_file(ledger_file=None): """Returns main ledger file path or raise exception if it cannot be \ found. If ledger_file is not None, use that path.""" if ledger_file is not None: return os.path.abspath(ledger_file) ledgerrcpath = os.path.abspath(os.path.expanduser("~/.ledgerrc")) if "LEDGER_FILE" in os.environ: return os.path.abspath(os.path.expanduser(os.environ["LEDGER_FILE"])) elif os.path.exists(ledgerrcpath): # hacky ledgerrc = open(ledgerrcpath).readlines() pat = r"^--file\s+(.*?)\s*$" matches = [ re.match(pat, m) for m in ledgerrc ] matches = [ m.group(1) for m in matches if m ] if not matches: raise LedgerConfigurationError("LEDGER_FILE environment variable not set, and your .ledgerrc file does not contain a --file parameter.") return os.path.abspath(os.path.expanduser(matches[0])) else: raise LedgerConfigurationError("LEDGER_FILE environment variable not set, and no \ .ledgerrc file found.") def add_months(sourcedate, months): month = sourcedate.month - 1 + months year = int(sourcedate.year + month / 12 ) month = month % 12 + 1 day = min(sourcedate.day,calendar.monthrange(year,month)[1]) return datetime.date(year,month,day) def find_ledger_price_file(price_file=None): """Returns main ledger file path or raise exception if it cannot be \ found. If price_file is not None, use that path.""" if price_file is not None: return os.path.abspath(price_file) ledgerrcpath = os.path.abspath(os.path.expanduser("~/.ledgerrc")) if "LEDGER_PRICE_DB" in os.environ: return os.path.abspath(os.path.expanduser(os.environ["LEDGER_PRICE_DB"])) elif os.path.exists(ledgerrcpath): # hacky ledgerrc = open(ledgerrcpath).readlines() pat = r"^--price-db\s+(.+)" matches = [ re.match(pat, m) for m in ledgerrc ] matches = [ m.group(1) for m in matches if m ] if not matches: raise LedgerConfigurationError("LEDGER_PRICE_DB environment variable not set, and your .ledgerrc file does not contain a --price-db parameter.") return os.path.abspath(os.path.expanduser(matches[0])) else: raise LedgerConfigurationError("LEDGER_PRICE_DB environment variable not set, and no \ .ledgerrc file found.") def generate_price_records(records): """Generates a set of price records. records is a list containing tuples. each tuple contains: commodity is a ledger commodity price is the price in ledger.Amount form date is a datetime.date """ lines = [""] longestcomm = max(list(len(str(a[0])) for a in records)) longestamount = max(list(len(str(a[1])) for a in records)) for commodity, price, date in records: fmt = "P %s %-" + str(longestcomm) + "s %" + str(longestamount) + "s" lines.append(fmt % ( date.strftime("%Y-%m-%d %H:%M:%S"), commodity, price, )) lines.append("") return lines class Settings(dict): def __init__(self, filename): self.data = dict() self.filename = filename @classmethod def load_or_defaults(cls, filename): s = cls(filename) if os.path.isfile(s.filename): try: s.data = pickle.load(open(s.filename, "rb")) except Exception as e: log.error("Cannot load %s so loading defaults: %s", s.filename, e) try: unused_suggester = s["suggester"] except KeyError: s["suggester"] = AccountSuggester() return s def __setitem__(self, item, value): self.data[item] = value self.persist() def __getitem__(self, item): return self.data[item] def __delitem__(self, item): if item in self.data: del self.data[item] self.persist() def keys(self): return list(self.data.keys()) def get(self, item, default): return self.data.get(item, default) def persist(self): p = open(self.filename, "wb") pickle.dump(self.data, p) p.flush() p.close() class AccountSuggester(object): def __init__(self): self.account_to_words = dict() def __str__(self): dump = str(self.account_to_words) return "" % dump def associate(self, words, account): words = [ w.lower() for w in words.split() ] account = str(account) if account not in self.account_to_words: self.account_to_words[account] = dict() for w in words: if w not in self.account_to_words[account]: self.account_to_words[account][w] = 0 self.account_to_words[account][w] += 1 def suggest(self, words): words = [ w.lower() for w in words.split() ] account_counts = dict() for account, ws in list(self.account_to_words.items()): for w, c in list(ws.items()): if w in words: if not account in account_counts: account_counts[account] = 0 account_counts[account] += c results = list(reversed(sorted( list(account_counts.items()), key=lambda x: x[1] ))) if results: return results[0][0] return None # ====================== GTK ======================= TransactionPosting = collections.namedtuple( 'TransactionPosting', ['account', 'amount'] ) ledgerhelpers-0.3.10/src/ledgerhelpers/dateentry.py000077500000000000000000000432221434235220400224120ustar00rootroot00000000000000#!/usr/bin/python3 # This code is imported straight from the Kiwi codebase, and ported to work # with GTK+ 3.x. # # The original source code is here: # http://doc.stoq.com.br/api/kiwi/_modules/kiwi/ui/dateentry.html # # The original program was provided under the LGPL 2.1 or later license terms. # As such, this program reuses it freely, linking it with the program is # permitted and should be no issue. import datetime from gi.repository import GObject import gi gi.require_version("Gdk", "3.0") gi.require_version("Gtk", "3.0") from gi.repository import Gdk from gi.repository import Gtk from ledgerhelpers.legacy import format_date, parse_date def prev_month(date): if date.month == 1: return datetime.date(date.year - 1, 12, date.day) else: day = date.day while True: try: return datetime.date(date.year, date.month - 1, day) except ValueError: day = day - 1 def next_month(date): if date.month == 12: return datetime.date(date.year + 1, 1, date.day) else: day = date.day while True: try: return datetime.date(date.year, date.month + 1, day) except ValueError: day = day - 1 def beginning_of_month(date): return datetime.date(date.year, date.month, 1) def end_of_month(date): if date.month == 12: date = datetime.date(date.year + 1, 1, 1) else: date = datetime.date(date.year, date.month + 1, 1) return date - datetime.timedelta(1) def prev_day(date): return date - datetime.timedelta(1) def next_day(date): return date + datetime.timedelta(1) def _according_to_keyval(keyval, state, date, skip="", in_editbox=False): if (keyval in (Gdk.KEY_Page_Up, Gdk.KEY_KP_Page_Up)): if date: return True, prev_month(date) else: return True, None if (keyval in (Gdk.KEY_Page_Down, Gdk.KEY_KP_Page_Down)): if date: return True, next_month(date) else: return True, None if ( keyval in (Gdk.KEY_minus, Gdk.KEY_KP_Subtract, Gdk.KEY_underscore) and "minus" not in skip ): if date: return True, prev_day(date) else: return True, None if (keyval in (Gdk.KEY_plus, Gdk.KEY_KP_Add, Gdk.KEY_equal, Gdk.KEY_KP_Equal)): if date: return True, next_day(date) else: return True, None if ( keyval in (Gdk.KEY_Home, Gdk.KEY_KP_Home) and (not in_editbox or state & Gdk.ModifierType.SHIFT_MASK) ): if date: return True, beginning_of_month(date) else: return True, None if ( keyval in (Gdk.KEY_End, Gdk.KEY_KP_End) and (not in_editbox or state & Gdk.ModifierType.SHIFT_MASK) ): if date: return True, end_of_month(date) else: return True, None return False, None class _DateEntryPopup(Gtk.Window): __gsignals__ = { 'date-selected': ( GObject.SIGNAL_RUN_LAST, None, (object,) ) } def __init__(self, dateentry): Gtk.Window.__init__(self, Gtk.WindowType.POPUP) self.add_events(Gdk.EventMask.BUTTON_PRESS_MASK) self.connect('key-press-event', self._on__key_press_event) self.connect('button-press-event', self._on__button_press_event) self._dateentry = dateentry frame = Gtk.Frame() frame.set_shadow_type(Gtk.ShadowType.ETCHED_IN) self.add(frame) frame.show() vbox = Gtk.VBox() vbox.set_border_width(12) frame.add(vbox) vbox.show() self._vbox = vbox self.calendar = Gtk.Calendar() self.calendar.connect('day-selected-double-click', self._on_calendar__day_selected_double_click) self.calendar.connect('day-selected', self._on_calendar__day_selected) vbox.pack_start(self.calendar, False, False, 0) self.calendar.show() buttonbox = Gtk.HButtonBox() buttonbox.set_border_width(12) buttonbox.set_layout(Gtk.ButtonBoxStyle.SPREAD) vbox.pack_start(buttonbox, False, False, 0) buttonbox.show() for label, callback in [('_Today', self._on_today__clicked), ('_Close', self._on_close__clicked)]: button = Gtk.Button(label, use_underline=True) button.connect('clicked', callback) buttonbox.pack_start(button, False, False, 0) button.show() self.set_resizable(False) self.set_screen(dateentry.get_screen()) self.realize() self.height = self._vbox.size_request().height def _on_calendar__day_selected_double_click(self, unused_calendar): self.emit('date-selected', self.get_date()) self.popdown() def _on_calendar__day_selected(self, unused_calendar): self.emit('date-selected', self.get_date()) def _on__button_press_event(self, unused_window, event): # If we're clicking outside of the window close the popup hide = False # Also if the intersection of self and the event is empty, hide # the calendar if (tuple(self.get_allocation().intersect( Gdk.Rectangle(x=int(event.x), y=int(event.y), width=1, height=1))) == (0, 0, 0, 0)): hide = True # Toplevel is the window that received the event, and parent is the # calendar window. If they are not the same, means the popup should # be hidden. This is necessary for when the event happens on another # widget toplevel = event.get_window().get_toplevel() parent = self.calendar.get_parent_window() if toplevel != parent: hide = True if hide: self.popdown() def _on__key_press_event(self, unused_window, event): """ Mimics Combobox behavior Escape, Enter or Alt+Up: Close Space: Select """ keyval = event.keyval state = event.state & Gtk.accelerator_get_default_mod_mask() if (keyval == Gdk.KEY_Escape or keyval in (Gdk.KEY_Return, Gdk.KEY_KP_Enter) or ((keyval == Gdk.KEY_Up or keyval == Gdk.KEY_KP_Up) and state == Gdk.ModifierType.MOD1_MASK)): self.popdown() return True processed, new_date = _according_to_keyval(keyval, state, self.get_date()) if processed and new_date: self.set_date(new_date) return processed def _on_select__clicked(self, unused_button): self.emit('date-selected', self.get_date()) def _on_close__clicked(self, unused_button): self.popdown() def _on_today__clicked(self, unused_button): self.set_date(datetime.date.today()) def _popup_grab_window(self): activate_time = 0 win = self.get_window() result = Gdk.pointer_grab(win, True, ( Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.BUTTON_RELEASE_MASK | Gdk.EventMask.POINTER_MOTION_MASK), None, None, activate_time ) if result == 0: if Gdk.keyboard_grab(self.get_window(), True, activate_time) == 0: return True else: self.get_window().get_display().pointer_ungrab(activate_time) return False return False def _get_position(self): self.realize() calendar = self sample = self._dateentry # We need to fetch the coordinates of the entry window # since comboentry itself does not have a window origin = sample.entry.get_window().get_origin() x, y = origin.x, origin.y width = calendar.size_request().width height = self.height screen = sample.get_screen() monitor_num = screen.get_monitor_at_window(sample.get_window()) monitor = screen.get_monitor_geometry(monitor_num) if x < monitor.x: x = monitor.x elif x + width > monitor.x + monitor.width: x = monitor.x + monitor.width - width alloc = sample.get_allocation() if y + alloc.height + height <= monitor.y + monitor.height: y += alloc.height elif y - height >= monitor.y: y -= height elif (monitor.y + monitor.height - (y + alloc.height) > y - monitor.y): y += alloc.height height = monitor.y + monitor.height - y else: height = y - monitor.y y = monitor.y return x, y, width, height def popup(self, date): """ Shows the list of options. And optionally selects an item :param date: date to select """ combo = self._dateentry if not (combo.get_realized()): return treeview = self.calendar if treeview.get_mapped(): return toplevel = combo.get_toplevel() if isinstance(toplevel, Gtk.Window) and toplevel.get_group(): toplevel.get_group().add_window(self) x, y, width, height = self._get_position() self.set_size_request(width, height) self.move(x, y) if date is not None: self.set_date(date) self.grab_focus() if not (self.calendar.has_focus()): self.calendar.grab_focus() self.show_all() if not self._popup_grab_window(): self.hide() return self.grab_add() def popdown(self): """Hides the list of options""" combo = self._dateentry if not (combo.get_realized()): return self.grab_remove() self.hide() # month in gtk.Calendar is zero-based (i.e the allowed values are 0-11) # datetime one-based (i.e. the allowed values are 1-12) # So convert between them def get_date(self): """Gets the date of the date entry :returns: date of the entry :rtype date: datetime.date """ y, m, d = self.calendar.get_date() return datetime.date(y, m + 1, d) def set_date(self, date): """Sets the date of the date entry :param date: date to set :type date: datetime.date """ self.calendar.select_month(date.month - 1, date.year) self.calendar.select_day(date.day) # FIXME: Only mark the day in the current month? self.calendar.clear_marks() self.calendar.mark_day(date.day) @GObject.type_register class DateEntry(Gtk.HBox): """I am an entry which you can input a date on. I make entering a date blazing fast. The date you input in me must be of the form YYYY-MM-DD or YYYY/MM/DD. These are the date formats expected by Ledger. In addition to the text box where you can type, I also contain a button with an icon you can click, to get a popup window with a date picker where you can select the date. You can also show the date picker by focusing me and then hitting Alt+Down on your keyboard. There are a number of cool combos you can use, whether in the text box or in the date picker popup: * Minus:\t\tprevious day * Plus:\t\tnext day * Page Up:\tprevious month * Page Down:\tnext month * Home:\t\tbeginning of the month (if textbox is focused, Shift+Home) * End:\t\tend of the month (if textbox is focused, Shift+End) In the date picker popup, hitting Enter, or Escape, or Alt+Up after selecting a date (making it blue with a click or with the Space bar) makes the date picker popup go away. Clicking outside the date picker popup also closes it. """ __gsignals__ = { 'changed': ( GObject.SIGNAL_RUN_LAST, None, () ), 'activate': ( GObject.SIGNAL_RUN_LAST, None, () ), } def __init__(self): Gtk.HBox.__init__(self) self._old_date = None self.entry = Gtk.Entry() self.entry.set_max_length(10) self.entry.set_width_chars(13) self.entry.set_overwrite_mode(True) self.entry.set_tooltip_text( self.__doc__.replace("\n ", "\n").strip() ) self.entry.set_property('primary-icon-name', "x-office-calendar") self.entry.connect('changed', self._on_entry__changed) self.entry.connect('activate', self._on_entry__activate) self.entry.connect('key-press-event', self._on_entry__key_press_event) self.entry.connect('icon-press', self._on_entry__icon_press) # ADD SUPPORT # self._button.connect('scroll-event', self._on_entry__scroll_event) self.entry.set_placeholder_text("Date") self.pack_start(self.entry, False, False, 0) self.entry.show() self._popup = _DateEntryPopup(self) self._popup.connect('date-selected', self._on_popup__date_selected) self._popup.connect('hide', self._on_popup__hide) self._popup.set_size_request(-1, 24) def _on_entry__icon_press(self, unused_entry, entry_icon_position, event_button): if ( entry_icon_position == Gtk.EntryIconPosition.PRIMARY and event_button.get_button() == (True, 1) ): self._popup_date_picker() return True def _on_entry__key_press_event(self, unused_window, event): keyval = event.keyval state = event.state & Gtk.accelerator_get_default_mod_mask() if ( (keyval == Gdk.KEY_Down or keyval == Gdk.KEY_KP_Down) and state == Gdk.ModifierType.MOD1_MASK ): self._popup_date_picker() return True skip_minus = "" if not self.get_date(): skip_minus = "minus" if self.entry.get_property("cursor-position") in (4, 7): skip_minus = "minus" processed, new_date = _according_to_keyval(keyval, state, self.get_date(), skip=skip_minus, in_editbox=True) if processed and new_date: self.set_date(new_date) return processed # Virtual methods def do_grab_focus(self): self.entry.grab_focus() # Callbacks def _on_entry__changed(self, unused_entry): try: date = self.get_date() except ValueError: date = None self._changed(date) def _on_entry__activate(self, unused_entry): self.emit('activate') def _on_entry__scroll_event(self, unused_entry, event): if event.direction == Gdk.SCROLL_UP: days = 1 elif event.direction == Gdk.SCROLL_DOWN: days = -1 else: return try: date = self.get_date() except ValueError: date = None if not date: newdate = datetime.date.today() else: newdate = date + datetime.timedelta(days=days) self.set_date(newdate) def _popup_date_picker(self): try: date = self.get_date() except ValueError: date = None self._popup.popup(date) def _on_popup__hide(self, popup): pass def _on_popup__date_selected(self, unused_popup, date): self.set_date(date) self.entry.grab_focus() self.entry.set_position(len(self.entry.get_text())) self._changed(date) def _changed(self, date): if self._old_date != date: self.emit('changed') self._old_date = date # Public API def set_activates_default(self, val): return self.entry.set_activates_default(val) def set_date(self, date): """Sets the date. :param date: date to set :type date: a datetime.date instance or None """ if not isinstance(date, datetime.date) and date is not None: raise TypeError( "date must be a datetime.date instance or None, not %r" % ( date, ) ) if date is None: value = '' else: try: value = format_date(date, self.entry.get_text()) except ValueError: value = format_date(date, "2016-12-01") self.entry.set_text(value) def get_date(self): """Get the selected date :returns: the date. :rtype: datetime.date or None """ try: date = self.entry.get_text() date = parse_date(date) except ValueError: date = None return date def follow(self, other_calendar): self.followed = other_calendar self.followed_last_value = other_calendar.get_date() def copy_when(other_calendar, *unused_args): if ( self.get_date() == self.followed_last_value or other_calendar.get_date() > self.get_date() ): self.set_date(other_calendar.get_date()) self.followed_last_value = other_calendar.get_date() other_calendar.connect("changed", copy_when) class TestWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="Whatever") self.set_border_width(12) combobox = DateEntry() self.add(combobox) def main(): klass = TestWindow win = klass() win.connect("delete-event", Gtk.main_quit) GObject.idle_add(win.show_all) Gtk.main() if __name__ == "__main__": main() ledgerhelpers-0.3.10/src/ledgerhelpers/diffing.py000077500000000000000000000031761434235220400220250ustar00rootroot00000000000000#!/usr/bin/python3 import subprocess import tempfile def three_way_diff(basefilename, leftcontents, rightcontents): """Given a file which is assumed to be utf-8, two utf-8 strings, left and right, launch a three-way diff. Raises: subprocess.CalledProcessError.""" if isinstance(leftcontents, str): leftcontents = leftcontents.encode("utf-8") if isinstance(rightcontents, str): rightcontents = rightcontents.encode("utf-8") prevfile = tempfile.NamedTemporaryFile(prefix=basefilename + ".previous.") prevfile.write(leftcontents) prevfile.flush() newfile = tempfile.NamedTemporaryFile(prefix=basefilename + ".new.") newfile.write(rightcontents) newfile.flush() try: subprocess.check_call( ('meld', prevfile.name, basefilename, newfile.name) ) finally: prevfile.close() newfile.close() def two_way_diff(leftcontents, rightcontents): """Given two strings which are assumed to be utf-8, open a two-way diff view with them. Raises: subprocess.CalledProcessError.""" if isinstance(leftcontents, str): leftcontents = leftcontents.encode("utf-8") if isinstance(rightcontents, str): rightcontents = rightcontents.encode("utf-8") prevfile = tempfile.NamedTemporaryFile(prefix=".base.") prevfile.write(leftcontents) prevfile.flush() newfile = tempfile.NamedTemporaryFile(prefix=".new.") newfile.write(rightcontents) newfile.flush() try: subprocess.check_call( ('meld', prevfile.name, newfile.name) ) finally: prevfile.close() newfile.close() ledgerhelpers-0.3.10/src/ledgerhelpers/editabletransactionview.py000077500000000000000000000326421434235220400253310ustar00rootroot00000000000000#!/usr/bin/python3 # coding: utf-8 from gi.repository import GObject import gi gi.require_version("Gdk", "3.0") gi.require_version("Gtk", "3.0") from gi.repository import Gdk from gi.repository import Gtk import ledgerhelpers as h import ledgerhelpers.legacy_needsledger as hln from ledgerhelpers import gui from ledgerhelpers.dateentry import DateEntry from ledgerhelpers.transactionstatebutton import TransactionStateButton class EditableTransactionView(Gtk.Grid): __gsignals__ = { 'changed': (GObject.SIGNAL_RUN_LAST, None, ()), 'payee-focus-out-event': (GObject.SIGNAL_RUN_LAST, None, ()), 'payee-changed': (GObject.SIGNAL_RUN_LAST, None, ()), } css = b""" editabletransactionview { border: 1px @borders inset; background: #fff; } editabletransactionview grid { border: none; } editabletransactionview entry { background: transparent; border: none; } editabletransactionview button { background: transparent; border: 1px solid transparent; } """ def __init__(self): gui.add_css(self.css) Gtk.Grid.__init__(self) self.set_column_spacing(0) self._postings_modified = False row = 0 container = Gtk.Grid() container.set_hexpand(False) container.set_column_spacing(0) self.when = DateEntry() self.when.set_activates_default(True) self.when.set_hexpand(False) container.attach(self.when, 0, 0, 1, 1) self.when.connect("changed", self.child_changed) self.clearing_when = DateEntry() self.clearing_when.set_activates_default(True) self.clearing_when.set_hexpand(False) self.clearing_when.follow(self.when) container.attach(self.clearing_when, 1, 0, 1, 1) self.clearing_when.connect("changed", self.child_changed) self.clearing = TransactionStateButton() container.attach(self.clearing, 2, 0, 1, 1) self.clearing.connect("clicked", self.child_changed) self.payee = gui.EagerCompletingEntry() self.payee.set_hexpand(True) self.payee.set_activates_default(True) self.payee.set_size_request(300, -1) self.payee.set_placeholder_text( "Payee or description (type for completion)" ) container.attach(self.payee, 3, 0, 1, 1) self.payee.connect("changed", self.payee_changed) self.payee.connect("changed", self.child_changed) self.payee.connect("focus-out-event", self.payee_focused_out) container.set_focus_chain( [self.when, self.clearing_when, self.clearing, self.payee] ) container_evbox = Gtk.EventBox() container_evbox.add(container) self.attach(container_evbox, 0, row, 1, 1) row += 1 self.lines_grid = Gtk.Grid() self.lines_grid.set_column_spacing(0) lines_evbox = Gtk.EventBox() lines_evbox.add(self.lines_grid) self.attach(lines_evbox, 0, row, 1, 1) self.lines = [] self.accounts_for_completion = Gtk.ListStore(GObject.TYPE_STRING) self.payees_for_completion = Gtk.ListStore(GObject.TYPE_STRING) self.add_line() for x in container_evbox, lines_evbox: x.connect("key-press-event", self.handle_keypresses) x.add_events(Gdk.EventMask.KEY_PRESS_MASK) def handle_keypresses(self, obj, ev): if ( ev.state & Gdk.ModifierType.CONTROL_MASK and (ev.keyval in ( Gdk.KEY_plus, Gdk.KEY_KP_Add, Gdk.KEY_equal, Gdk.KEY_KP_Equal, Gdk.KEY_minus, Gdk.KEY_KP_Subtract, Gdk.KEY_underscore, Gdk.KEY_Page_Up, Gdk.KEY_KP_Page_Up, Gdk.KEY_Page_Down, Gdk.KEY_KP_Page_Down, )) ): if ev.state & Gdk.ModifierType.SHIFT_MASK: return self.clearing_when._on_entry__key_press_event(obj, ev) else: return self.when._on_entry__key_press_event(obj, ev) if (ev.state & Gdk.ModifierType.MOD1_MASK): keybobjects = { Gdk.KEY_t: self.when, Gdk.KEY_l: self.clearing_when, Gdk.KEY_p: self.payee, } for keyval, obj in list(keybobjects.items()): if ev.keyval == keyval: obj.grab_focus() return True def set_transaction_date(self, date): self.when.set_date(date) def set_accounts_for_completion(self, account_list): accounts = Gtk.ListStore(GObject.TYPE_STRING) [accounts.append((str(a),)) for a in account_list] for account, unused_amount in self.lines: account.get_completion().set_model(accounts) self.accounts_for_completion = accounts def set_payees_for_completion(self, payees_list): payees = Gtk.ListStore(GObject.TYPE_STRING) [payees.append((a,)) for a in payees_list] self.payee.get_completion().set_model(payees) self.payees_for_completion = payees def handle_data_changes(self, widget, unused_eventfocus): numlines = len(self.lines) for n, (account, amount) in reversed(list(enumerate(self.lines))): if n + 1 == numlines: continue p = amount.get_amount_and_price_formatted() if not account.get_text().strip() and not p: self.remove_line(n) last_account = self.lines[-1][0] last_amount = self.lines[-1][1] a, p = last_amount.get_amount_and_price() if (a or p) and last_account.get_text().strip(): self.add_line() acctswidgets = dict((w[0], n) for n, w in enumerate(self.lines)) if widget in acctswidgets: # If the account in the account widget has an associated # default commodity, then we set the default commodity of the # amount widget to the commodity for the account. account = widget.get_text().strip() amountwidget = self.lines[acctswidgets[widget]][1] c = self._get_default_commodity(account) if c: amountwidget.set_default_commodity(c) amtwidgets = dict((w[1], n) for n, w in enumerate(self.lines)) if widget in amtwidgets: # If the amount widget has an amount, and the account associated # with it does not have a default commodity, and the widget itself # has a default commodity that differs from its current amount's # commodity, then we set the default commodity of the amount widget # to match the commodity of the amount entered in it. # This is extremely useful when clients of this data entry grid # are autofilling this grid, but haven't yet given us a default # commodity getter to discover account commodities. if widget.get_amount(): currdef = widget.get_default_commodity() currcom = widget.get_amount().commodity accountwidget = self.lines[amtwidgets[widget]][0] account = accountwidget.get_text().strip() c = self._get_default_commodity(account) if not c and str(currdef) != str(currcom): widget.set_default_commodity(currcom) if widget in [x[0] for x in self.lines] + [x[1] for x in self.lines]: self._postings_modified = True def set_default_commodity_getter(self, getter): """Records the new commodity getter. A getter is a callable that takes one account name and returns one commodity to be used as default for that account. If the getter cannot find a default commodity, it must return None. """ self._default_commodity_getter = getter for line in self.lines: accountwidget = line[0] amountwidget = line[1] account = accountwidget.get_text().strip() c = self._get_default_commodity(account) if c: amountwidget.set_default_commodity(c) def _get_default_commodity(self, account_name): getter = getattr(self, "_default_commodity_getter", None) if getter: return getter(account_name) def child_changed(self, w, unused=None): self.handle_data_changes(w, None) self.emit("changed") def payee_changed(self, unused_w, unused=None): self.emit("payee-changed") def payee_focused_out(self, unused_w, unused=None): self.emit("payee-focus-out-event") def get_payee_text(self): return self.payee.get_text() def remove_line(self, number): account, amount = self.lines[number] account_is_focus = account.is_focus() amount_is_focus = amount.is_focus() for hid in account._handler_ids: account.disconnect(hid) for hid in amount._handler_ids: amount.disconnect(hid) self.lines.pop(number) self.lines_grid.remove_row(number) try: account, amount = self.lines[number] except IndexError: account, amount = self.lines[number - 1] if account_is_focus: account.grab_focus() if amount_is_focus: amount.grab_focus() def postings_modified(self): return self._postings_modified def postings_empty(self): return ( len(self.lines) < 2 and not self.lines[0][0].get_text() and not self.lines[0][0].get_text() ) def _clear_postings(self): while len(self.lines) > 1: self.remove_line(0) self.lines[0][0].set_text("") self.lines[0][1].set_amount_and_price(None, None) def clear(self): self._clear_postings() self.payee.set_text("") self._postings_modified = False def set_clearing(self, clearingstate): self.clearing.set_state(clearingstate) def replace_postings(self, transactionpostings): """Replace postings with a list of TransactionPosting.""" self._clear_postings() for n, tp in enumerate(transactionpostings): self.add_line() self.lines[n][0].set_text(tp.account) self.lines[n][1].set_text(tp.amount) self._postings_modified = False def add_line(self): account = gui.EagerCompletingEntry() account.set_hexpand(True) account.set_width_chars(40) account.set_activates_default(True) account.get_completion().set_model(self.accounts_for_completion) account.set_placeholder_text( "Account (type for completion)" ) hid3 = account.connect("changed", self.child_changed) account._handler_ids = [hid3] amount = gui.LedgerAmountWithPriceEntry(display=False) amount.set_activates_default(True) amount.set_placeholder_text("Amount") hid3 = amount.connect("changed", self.child_changed) amount._handler_ids = [hid3] row = len(self.lines) if amount.display: amount.remove(amount.display) self.lines_grid.attach(amount.display, 0, row, 1, 1) amount.remove(amount.entry) self.lines_grid.attach(amount.entry, 1, row, 1, 1) else: amount.remove(amount.entry) self.lines_grid.attach(amount.entry, 0, row, 1, 1) self.lines_grid.attach(account, 2, row, 1, 1) account.show() amount.show() self.lines.append((account, amount)) def title_grab_focus(self): self.payee.grab_focus() def lines_grab_focus(self): for account, amount in self.lines: if not account.get_text().strip(): account.grab_focus() return if not amount.get_amount_and_price_formatted(): amount.grab_focus() return else: if self.lines: self.lines[0][1].grab_focus() pass def get_data_for_transaction_record(self): title = self.payee.get_text().strip() date = self.when.get_date() clearing_state = self.clearing.get_state_char() clearing_when = self.clearing_when.get_date() def get_entries(): entries = [] for account, amount in self.lines: account = account.get_text().strip() p = amount.get_amount_and_price_formatted() if account or p: entries.append((account, p)) return entries accountamounts = [(x, y) for x, y in get_entries()] return title, date, clearing_when, clearing_state, accountamounts def validate(self, grab_focus=False): """Raises ValidationError if the transaction is not valid.""" title, date, auxdate, statechar, lines = ( self.get_data_for_transaction_record() ) if not title: if grab_focus: self.payee.grab_focus() raise h.TransactionInputValidationError( "Transaction title cannot be empty" ) if len(lines) < 2: if grab_focus: self.lines_grab_focus() raise h.TransactionInputValidationError( "Enter at least two transaction entries" ) try: hln.generate_record(title, date, auxdate, statechar, lines, validate=True) except hln.LedgerParseError as e: raise h.TransactionInputValidationError(str(e)) EditableTransactionView.set_css_name("editabletransactionview") ledgerhelpers-0.3.10/src/ledgerhelpers/gui.py000066400000000000000000000254111434235220400211740ustar00rootroot00000000000000import ledger import ledgerhelpers import ledgerhelpers.legacy as hl import ledgerhelpers.legacy_needsledger as hln import os import sys import threading import gi gi.require_version("Gdk", "3.0") gi.require_version("Gtk", "3.0") from gi.repository import GObject from gi.repository import Gdk from gi.repository import Gtk from gi.repository import Pango EVENT_TAB = 65289 EVENT_SHIFTTAB = 65056 EVENT_ESCAPE = 65307 _css_adjusted = {} def g_async(func, success_func, failure_func): def f(): try: GObject.idle_add(success_func, func()) except BaseException as e: GObject.idle_add(failure_func, e) t = threading.Thread(target=f) t.setDaemon(True) t.start() return t def add_css(css): # Must only ever be called at runtime, not at import time. global _css_adjusted if css not in _css_adjusted: style_provider = Gtk.CssProvider() if isinstance(css, str): css = css.encode("utf-8") style_provider.load_from_data(css) Gtk.StyleContext.add_provider_for_screen( Gdk.Screen.get_default(), style_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION ) _css_adjusted[css] = True def FatalError(message, secondary=None, parent=None): d = Gtk.MessageDialog( parent, Gtk.DialogFlags.DESTROY_WITH_PARENT, Gtk.MessageType.ERROR, Gtk.ButtonsType.CLOSE, message, ) if secondary: d.format_secondary_text(secondary) d.run() def cannot_start_dialog(msg): return FatalError("Cannot start program", msg) class EagerCompletion(Gtk.EntryCompletion): """Completion class that substring matches within a builtin ListStore.""" def __init__(self, *args): Gtk.EntryCompletion.__init__(self, *args) self.set_model(Gtk.ListStore(GObject.TYPE_STRING)) self.set_match_func(self.iter_points_to_matching_entry) self.set_text_column(0) self.set_inline_completion(True) def iter_points_to_matching_entry(self, unused_c, k, i, unused=None): model = self.get_model() acc = model.get(i, 0)[0].lower() if k.lower() in acc: return True return False def load_journal_and_settings_for_gui(price_file_mandatory=False, ledger_file=None, price_file=None): try: ledger_file = ledgerhelpers.find_ledger_file(ledger_file) except Exception as e: cannot_start_dialog(str(e)) sys.exit(4) try: price_file = ledgerhelpers.find_ledger_price_file(price_file) except ledgerhelpers.LedgerConfigurationError as e: if price_file_mandatory: cannot_start_dialog(str(e)) sys.exit(4) else: price_file = None except Exception as e: cannot_start_dialog(str(e)) sys.exit(4) try: from ledgerhelpers.journal import Journal journal = Journal.from_file(ledger_file, price_file) except Exception as e: cannot_start_dialog("Cannot open ledger file: %s" % e) sys.exit(5) s = ledgerhelpers.Settings.load_or_defaults( os.path.expanduser("~/.ledgerhelpers.ini") ) return journal, s def find_ledger_file_for_gui(): try: ledger_file = ledgerhelpers.find_ledger_file() return ledger_file except Exception as e: cannot_start_dialog(str(e)) sys.exit(4) class EagerCompletingEntry(Gtk.Entry): """Entry that substring-matches eagerly using a builtin ListStore-based Completion, and also accepts defaults. """ prevent_completion = False def __init__(self, *args): Gtk.Entry.__init__(self, *args) self.default_text = '' self.old_default_text = '' self.set_completion(EagerCompletion()) def set_default_text(self, default_text): self.old_default_text = self.default_text self.default_text = default_text if not self.get_text() or self.get_text() == self.old_default_text: self.set_text(self.default_text) class LedgerAmountEntry(Gtk.Grid): __gsignals__ = { 'changed': (GObject.SIGNAL_RUN_LAST, None, ()) } default_commodity = None def show(self): Gtk.Grid.show(self) self.entry.show() if self.display: self.display.show() def do_changed(self): pass def set_placeholder_text(self, text): self.entry.set_placeholder_text(text) def __init__(self, display=True): Gtk.Grid.__init__(self) self.amount = None self.entry = Gtk.Entry() self.entry.set_width_chars(8) if display: self.display = Gtk.Label() else: self.display = None self.entry.set_alignment(1.0) self.attach(self.entry, 0, 0, 1, 1) if self.display: self.attach(self.display, 1, 0, 1, 1) self.display.set_halign(Gtk.Align.END) self.display.set_justify(Gtk.Justification.RIGHT) self.set_column_spacing(4) self.donotreact = False self.entry.connect("changed", self.entry_changed) self.set_default_commodity(ledger.Amount("$ 1").commodity) self.set_activates_default = self.entry.set_activates_default def get_default_commodity(self): return self.default_commodity def set_default_commodity(self, commodity): if isinstance(commodity, ledger.Amount): commodity = commodity.commodity if str(self.default_commodity) != str(commodity): self.default_commodity = commodity self.entry.emit("changed") def is_focus(self): return self.entry.is_focus() def grab_focus(self): self.entry.grab_focus() def get_amount(self): return self.amount def set_amount(self, amount, skip_entry_update=False): self.amount = amount if self.display: self.display.set_text(str(amount) if amount is not None else "") self.donotreact = True if not skip_entry_update: self.entry.set_text(str(amount) if amount is not None else "") self.donotreact = False self.emit("changed") def set_text(self, text): self.entry.set_text(text) def _adjust_entry_size(self, w): text = w.get_text() w.set_width_chars(max([8, len(text)])) def entry_changed(self, w, *unused_args): self._adjust_entry_size(w) if self.donotreact: return text = self.entry.get_text() try: p = ledger.Amount(text) except ArithmeticError: self.set_amount(None, True) self.emit("changed") return if not str(p.commodity): p.commodity = self.default_commodity if str(p): self.set_amount(p, True) else: self.set_amount(None, True) self.emit("changed") class LedgerAmountWithPriceEntry(LedgerAmountEntry): def __init__(self, display=True): self.price = None LedgerAmountEntry.__init__(self, display=display) def get_amount_and_price(self): return self.amount, self.price def get_amount_and_price_formatted(self): if self.amount and self.price: return str(self.amount) + " " + self.price.strip() elif self.amount: return str(self.amount) elif self.price: return self.price else: return "" def set_amount_and_price(self, amount, price, skip_entry_update=False): self.amount = amount self.price = price p = [ str(amount if amount is not None else "").strip(), str(price if price is not None else "").strip(), ] p = [x for x in p if x] concat = " ".join(p) if self.display: self.display.set_text(concat) self.donotreact = True if not skip_entry_update: self.entry.set_text(concat) self.donotreact = False def entry_changed(self, w, *unused_args): self._adjust_entry_size(w) if self.donotreact: return text = self.entry.get_text() i = text.find("@") if i != -1: price = text[i:] if text[i:] else None text = text[:i] else: price = None try: p = ledger.Amount(text) except ArithmeticError: self.set_amount_and_price(None, price, True) self.emit("changed") return if not str(p.commodity): p.commodity = self.default_commodity if str(p): self.set_amount_and_price(p, price, True) else: self.set_amount_and_price(None, price, True) self.emit("changed") class EditableTabFocusFriendlyTextView(Gtk.TextView): def __init__(self, *args): Gtk.TextView.__init__(self, *args) self.connect("key-press-event", self.handle_tab) def handle_tab(self, widget, event): if event.keyval == EVENT_TAB: widget.get_toplevel().child_focus(Gtk.DirectionType.TAB_FORWARD) return True elif event.keyval == EVENT_SHIFTTAB: widget.get_toplevel().child_focus(Gtk.DirectionType.TAB_BACKWARD) return True return False class LedgerTransactionView(Gtk.Box): css = b""" ledgertransactionview { border: 1px @borders inset; } """ def __init__(self, *args): add_css(self.css) Gtk.Box.__init__(self) self.textview = EditableTabFocusFriendlyTextView(*args) self.textview.override_font( Pango.font_description_from_string('monospace') ) self.textview.set_border_width(12) self.textview.set_hexpand(True) self.textview.set_vexpand(True) self.add(self.textview) self.textview.get_buffer().set_text( "# A live preview will appear here as you input data." ) def get_buffer(self): return self.textview.get_buffer() def generate_record(self, *args): lines = hln.generate_record(*args) self.textview.get_buffer().set_text("\n".join(lines)) LedgerTransactionView.set_css_name("ledgertransactionview") class EscapeHandlingMixin(object): escape_handling_suspended = False def activate_escape_handling(self): self.connect("key-press-event", self.handle_escape) def suspend_escape_handling(self): self.escape_handling_suspended = True def resume_escape_handling(self): self.escape_handling_suspended = False def handle_escape(self, unused_window, event, unused_user_data=None): if ( not self.escape_handling_suspended and event.keyval == EVENT_ESCAPE ): self.emit('delete-event', None) return True return False ledgerhelpers-0.3.10/src/ledgerhelpers/journal.py000077500000000000000000000304661434235220400220730ustar00rootroot00000000000000#!/usr/bin/python3 import collections import errno import ledger from ledgerhelpers import parser, debug_time import ledgerhelpers.legacy_needsledger as hln import logging from multiprocessing import Process, Pipe import os import threading import time UNCHANGED = "unchanged" UNCONDITIONAL = "unconditional" IFCHANGED = "ifchanged" CMD_GET_A_LCFA_C = "get_accounts_last_commodity_for_account_and_commodities" def transactions_with_payee(payee, internal_parsing_result, case_sensitive=True): """Given a payee string, and an internal_parsing() result from the journal, return the transactions with matching payee, perhaps ignoring case.""" transes = [] if not case_sensitive: payee = payee.lower() for xact in internal_parsing_result: if not hasattr(xact, "payee"): continue xact_payee = xact.payee if case_sensitive else xact.payee.lower() if xact_payee == payee: transes.append(xact) return transes class Joinable(threading.Thread): """A subclass of threading.Thread that catches exception in run(), if any, and re-throws it in join().""" exception = None def __init__(self): threading.Thread.__init__(self, daemon=True) def join(self): threading.Thread.join(self) if self.exception: raise self.exception def run(self): try: self.__run__() except BaseException as e: self.exception = e class JournalCommon(): path = None path_mtime = None price_path = None price_path_mtime = None def changed(self): path_mtime = None price_path_mtime = None try: path_mtime = os.stat(self.path).st_mtime except OSError as e: if e.errno != errno.ENOENT: raise try: if self.price_path is not None: price_path_mtime = os.stat(self.price_path).st_mtime except OSError as e: if e.errno != errno.ENOENT: raise if ( path_mtime != self.path_mtime or price_path_mtime != self.price_path_mtime ): self.path_mtime = path_mtime self.price_path_mtime = price_path_mtime self.logger.debug("Files have changed, rereading.") return True else: return False def _get_text(self, prepend_price_path=False): files = [] if self.price_path and prepend_price_path: files.append(self.price_path) if self.path: files.append(self.path) t = [] for f in files: with open(f, "r") as fo: t.append(fo.read()) text = "\n".join(t) self.logger.debug("Read %d characters of journal%s.", len(text), " and price file" if len(files) > 1 else "") return text def get_journal_text_with_prices(self): return self._get_text(True) def get_journal_text(self): return self._get_text(False) class Journal(JournalCommon): logger = logging.getLogger("journal.master") pipe = None slave = None slave_lock = None cache = None internal_parsing_cache = None internal_parsing_cache_lock = None def __init__(self): """Do not instantiate directly. Use class methods.""" self.cache = {} self.internal_parsing_cache = [] self.internal_parsing_cache_lock = threading.Lock() self.slave_lock = threading.Lock() def _start_slave(self): if self.pipe: self.pipe.close() self.pipe, theirconn = Pipe() if self.slave: try: self.slave.terminate() except Exception: pass try: self.slave = JournalSlave(theirconn, self.path, self.price_path) self.slave.start() finally: theirconn.close() @classmethod def from_file(klass, journal_file, price_file): j = klass() j.path = journal_file j.price_path = price_file j._start_slave() j._cache_internal_parsing() return j def _cache_internal_parsing(self): self.internal_parsing_cache_lock.acquire() if self.changed(): me = self self.internal_parsing_cache = None class Rpi(Joinable): @debug_time(self.logger) def __run__(self): try: me.logger.debug("Reparsing internal.") res = parser.lex_ledger_file_contents(me.get_journal_text()) me.internal_parsing_cache = res finally: me.internal_parsing_cache_lock.release() internal_parsing_thread = Rpi() internal_parsing_thread.name = "Internal reparser" internal_parsing_thread.start() return internal_parsing_thread else: # Dummy thread. Just serves to unlock the parsing cache lock. nothread = threading.Thread(target=self.internal_parsing_cache_lock.release) nothread.start() return nothread def _cache_accounts_last_commodity_for_account_and_commodities(self): with self.slave_lock: try: self.pipe.send( (CMD_GET_A_LCFA_C, IFCHANGED if "accounts" in self.cache else UNCONDITIONAL) ) result = self.pipe.recv() if isinstance(result, BaseException): raise result if result == UNCHANGED: assert "accounts" in self.cache else: accounts = result[0] if result[0] is not None else [] last_commodity_for_account = dict( (acc, ledger.Amount(amt)) for acc, amt in list(result[1].items()) ) if result[1] is not None else {} all_commodities = [ ledger.Amount(c) for c in result[2] ] if result[2] is not None else [] self.cache["accounts"] = accounts self.cache["last_commodity_for_account"] = ( last_commodity_for_account ) self.cache["all_commodities"] = all_commodities except BaseException: self.cache = {} self._start_slave() raise @debug_time(logger) def accounts_and_last_commodity_for_account(self): self._cache_accounts_last_commodity_for_account_and_commodities() return self.cache["accounts"], self.cache["last_commodity_for_account"] @debug_time(logger) def commodities(self): self._cache_accounts_last_commodity_for_account_and_commodities() return self.cache["all_commodities"] def commodity(self, label, create=False): pool = ledger.Amount("$ 1").commodity.pool() if create: return pool.find_or_create(label) else: return pool.find(label) @debug_time(logger) def all_payees(self): """Returns a list of strings with payees (transaction titles).""" titles = collections.OrderedDict() for xact in self.internal_parsing(): if hasattr(xact, "payee") and xact.payee not in titles: titles[xact.payee] = xact.payee return list(titles.keys()) @debug_time(logger) def internal_parsing(self): self._cache_internal_parsing().join() with self.internal_parsing_cache_lock: return self.internal_parsing_cache def generate_record(self, *args): return hln.generate_record(*args) def generate_price_records(self, prices): from ledgerhelpers import generate_price_records return generate_price_records(prices) def _add_text_to_file(self, text, f): if not isinstance(text, str): text = "\n".join(text) f = open(f, "a") print(text, file=f) f.flush() f.close() def add_text_to_file(self, text): return self._add_text_to_file(text, self.path) def add_text_to_price_file(self, text): return self._add_text_to_file(text, self.price_path) class JournalSlave(JournalCommon, Process): session = None journal = None accounts = None last_commodity_for_account = None all_commodities = None logger = logging.getLogger("journal.slave") def __init__(self, pipe, path, price_path): Process.__init__(self) self.daemon = True self.pipe = pipe self.path = path self.price_path = price_path self.clear_caches() def clear_caches(self): self.session = None self.journal = None self.accounts = None self.last_commodity_for_account = None self.all_commodities = None def reparse_ledger(self): self.logger.debug("Reparsing ledger.") session = ledger.Session() journal = session.read_journal_from_string(self.get_journal_text_with_prices()) self.session = session self.journal = journal def harvest_accounts_and_last_commodities(self): self.logger.debug("Harvesting accounts and last commodities.") # Commodities returned by this method do not contain any annotations. accts = [] commos = dict() amts = dict() for post in self.journal.query(""): for subpost in post.xact.posts(): if str(subpost.account) not in accts: accts.append(str(subpost.account)) comm = ledger.Amount(1).with_commodity(subpost.amount.commodity) comm.commodity = comm.commodity.strip_annotations() commos[str(subpost.account)] = str(comm) amts[str(comm)] = True self.accounts = accts self.last_commodity_for_account = commos self.all_commodities = [str(k) for k in list(amts.keys())] def reparse_all_if_needed(self): me = self changed = self.changed() if changed: self.clear_caches() class Rpl(Joinable): @debug_time(self.logger) def __run__(self): me.reparse_ledger() me.harvest_accounts_and_last_commodities() ledger_parsing_thread = Rpl() ledger_parsing_thread.name = "Ledger reparser" else: ledger_parsing_thread = threading.Thread(target=len, args=([],)) ledger_parsing_thread.name = "Dummy ledger reparser" ledger_parsing_thread.start() return ( changed, ledger_parsing_thread ) def run(self): logger = logging.getLogger("journal.slave.loop") _, initial_parsing_thread = self.reparse_all_if_needed() while True: cmd_args = self.pipe.recv() if initial_parsing_thread: initial_parsing_thread.join() initial_parsing_thread = None cmd = cmd_args[0] start = time.time() logger.debug("* Servicing: %-55s started", cmd) args = cmd_args[1:] try: changed, lpt = self.reparse_all_if_needed() if cmd == CMD_GET_A_LCFA_C: if ( not changed and args[0] == IFCHANGED and self.journal ): logger.debug("* Serviced: %-55s %.3f seconds - %s", cmd, time.time() - start, UNCHANGED) self.pipe.send(UNCHANGED) continue lpt.join() logger.debug("* Serviced: %-55s %.3f seconds - new data", cmd, time.time() - start) self.pipe.send(( self.accounts, self.last_commodity_for_account, self.all_commodities, )) else: assert 0, "not reached" except BaseException as e: logger.exception("Unrecoverable error in slave.") self.pipe.send(e) ledgerhelpers-0.3.10/src/ledgerhelpers/legacy.py000066400000000000000000000140541434235220400216550ustar00rootroot00000000000000import datetime import fcntl import struct import termios import tty CURSOR_UP = "\033[F" QUIT = "quit" yes_chars = "yY\n\r" no_chars = "nN\x7f" yesno_choices = dict() for char in yes_chars: yesno_choices[char] = True for char in no_chars: yesno_choices[char] = False del char del yes_chars del no_chars class Escaped(KeyboardInterrupt): pass def go_cursor_up(fd): fd.write(CURSOR_UP) def blank_line(fd, chars): fd.write(" " * chars) print() def read_one_character(from_): old_settings = termios.tcgetattr(from_.fileno()) try: tty.setraw(from_.fileno()) char = from_.read(1) if char == "\x1b": raise Escaped() if char == "\x03": raise KeyboardInterrupt() finally: termios.tcsetattr(from_.fileno(), termios.TCSADRAIN, old_settings) return char def print_line_ellipsized(fileobj, maxlen, text): if len(text) > maxlen: text = text[:maxlen] fileobj.write(text) fileobj.flush() print() def get_terminal_size(fd): def ioctl_GWINSZ(fd): return struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234')) return ioctl_GWINSZ(fd) def get_terminal_width(fd): return get_terminal_size(fd)[1] def prompt_for_account(fdin, fdout, accounts, prompt, default): cols = get_terminal_width(fdin) line = prompt + ("" if not default else " '': %s" % default) print_line_ellipsized(fdout, cols, line) x = [] match = default while True: char = read_one_character(fdin) if char in "\n\r\t": break elif char == "\x7f": if x: x.pop() else: x.append(char) inp = "".join(x) if not inp: match = default else: matches = [ a for a in accounts if inp.lower() in a.lower() ] match = matches[0] if matches else inp if inp else default cols = get_terminal_width(fdin) go_cursor_up(fdout) blank_line(fdout, cols) go_cursor_up(fdout) line = prompt + " " + "'%s': %s" % (inp, match) print_line_ellipsized(fdout, cols, line) return match def choose(fdin, fdout, prompt, map_choices): """Based on single-char input, return a value from map_choices.""" cols = get_terminal_width(fdin) line = prompt print_line_ellipsized(fdout, cols, line) while True: char = read_one_character(fdin) if char in map_choices: return map_choices[char] def yesno(fdin, fdout, prompt): """Return True upon yY or ENTER, return False upon nN or BACKSPACE.""" return choose(fdin, fdout, prompt, yesno_choices) def prompt_for_expense(prompt): return input(prompt + " ").strip() def prompt_for_date(fdin, fdout, prompt, initial, optional=False): """Return None if bool(optional) evaluates to True.""" cols = get_terminal_width(fdin) if optional: opt = "[+/- changes, n skips, ENTER/tab accepts]" else: opt = "[+/- changes, ENTER/tab accepts]" line = prompt + ("" if not initial else " %s" % initial) print_line_ellipsized(fdout, cols, line + " " + opt) while True: char = read_one_character(fdin) if char in "\n\r\t": break elif char == "+": initial = initial + datetime.timedelta(1) elif char == "-": initial = initial + datetime.timedelta(-1) elif char in "nN" and optional: return None cols = get_terminal_width(fdin) go_cursor_up(fdout) blank_line(fdout, cols) go_cursor_up(fdout) line = prompt + " " + "%s" % initial print_line_ellipsized(fdout, cols, line + " " + opt) return initial def prompt_for_date_optional(fdin, fdout, prompt, initial): return prompt_for_date(fdin, fdout, prompt, initial, True) def parse_date(putative_date, return_format=False): """Returns a date substring in a ledger entry, parsed as datetime.date.""" # FIXME: use Ledger functions to parse dates, not mine. formats = ["%Y-%m-%d", "%Y/%m/%d"] for f in formats: try: d = datetime.datetime.strptime(putative_date, f).date() break except ValueError as e: last_exception = e continue try: if return_format: return d, f else: return d except UnboundLocalError: raise ValueError("cannot parse date from format %s: %s" % (f, last_exception)) def format_date(date_obj, sample_date): _, fmt = parse_date(sample_date, True) return date_obj.strftime(fmt) def generate_record(title, date, auxdate, state, accountamounts): """Generates a transaction record. date is a datetime.date title is a string describing the title of the transaction auxdate is the date when the transaction cleared, or None statechar is a char from parser.CHAR_* or empty string accountamounts is a list of: (account, amount) """ def stramt(amt): assert type(amt) not in (tuple, list), amt if not amt: return "" return str(amt).strip() if state: state = state + " " else: state = "" lines = [""] linesemptyamts = [] if auxdate: if auxdate != date: lines.append("%s=%s %s%s" % (date, auxdate, state, title)) else: lines.append("%s %s%s" % (date, state, title)) else: lines.append("%s %s%s" % (date, state, title)) try: longest_acct = max(list(len(a) for a, _ in accountamounts)) longest_amt = max(list(len(stramt(am)) for _, am in accountamounts)) except ValueError: longest_acct = 30 longest_amt = 30 pattern = " %-" + str(longest_acct) + "s %" + str(longest_amt) + "s" pattern2 = " %-" + str(longest_acct) + "s" for account, amount in accountamounts: if stramt(amount): lines.append(pattern % (account, stramt(amount))) else: linesemptyamts.append((pattern2 % (account,)).rstrip()) lines = lines + linesemptyamts lines.append("") return lines ledgerhelpers-0.3.10/src/ledgerhelpers/legacy_needsledger.py000066400000000000000000000041551434235220400242170ustar00rootroot00000000000000from ledgerhelpers.legacy import get_terminal_width, \ print_line_ellipsized, read_one_character, go_cursor_up, blank_line, \ generate_record as generate_record_novalidate import ledger class LedgerParseError(ValueError): pass def prompt_for_amount(fdin, fdout, prompt, commodity_example): cols = get_terminal_width(fdin) line = prompt + ("" if not commodity_example else " '': %s" % commodity_example) print_line_ellipsized(fdout, cols, line) x = [] match = commodity_example while True: char = read_one_character(fdin) if char in "\n\r\t": break elif char == "\x7f": if x: x.pop() else: x.append(char) inp = "".join(x) try: match = ledger.Amount(inp) * commodity_example except ArithmeticError: try: match = ledger.Amount(inp) except ArithmeticError: match = "" cols = get_terminal_width(fdin) go_cursor_up(fdout) blank_line(fdout, cols) go_cursor_up(fdout) line = prompt + " " + "'%s': %s" % (inp, match) print_line_ellipsized(fdout, cols, line) assert match is not None return match def generate_record(title, date, auxdate, state, accountamounts, validate=False): """Generates a transaction record. See callee. Validate uses Ledger to validate the record. """ lines = generate_record_novalidate( title, date, auxdate, state, accountamounts ) if validate: sess = ledger.Session() try: sess.read_journal_from_string("\n".join(lines)) except RuntimeError as e: lines = [x.strip() for x in str(e).splitlines() if x.strip()] lines = [x for x in lines if not x.startswith("While")] lines = [x + ("." if not x.endswith(":") else "") for x in lines] lines = " ".join(lines) if lines: raise LedgerParseError(lines) else: raise LedgerParseError("Ledger could not validate this transaction") return lines ledgerhelpers-0.3.10/src/ledgerhelpers/parser.py000077500000000000000000000424111434235220400217060ustar00rootroot00000000000000#!/usr/bin/python3 import ledgerhelpers.legacy from ledgerhelpers import diffing CHAR_ENTER = "\n" CHAR_COMMENT = ";#" CHAR_NUMBER = "1234567890" CHAR_TAB = "\t" CHAR_WHITESPACE = " \t" CHAR_CLEARED = "*" CHAR_PENDING = "!" STATE_CLEARED = CHAR_CLEARED STATE_PENDING = CHAR_PENDING STATE_UNCLEARED = None def pos_within_items_to_row_and_col(pos, items): row = 1 col = 1 for i, c in enumerate(items): if i >= pos: break if c in CHAR_ENTER: row += 1 col = 1 else: col += 1 return row, col def parse_date_from_transaction_contents(contents): return ledgerhelpers.legacy.parse_date("".join(contents)) class Token(object): def __init__(self, pos, contents): self.pos = pos if not isinstance(contents, str): contents = "".join(contents) self.contents = contents def __str__(self): return """<%s at pos %d len %d %s>""" % (self.__class__.__name__, self.pos, len(self.contents), self.contents) class TokenComment(Token): pass class TokenTransactionComment(Token): pass class TokenTransactionClearedFlag(Token): pass class TokenTransactionPendingFlag(Token): pass class TokenWhitespace(Token): pass class TokenTransaction(Token): def __init__(self, pos, contents): Token.__init__(self, pos, contents) lexer = LedgerTransactionLexer(contents) lexer.run() def find_token(klass): try: return [t for t in lexer.tokens if isinstance(t, klass)][0] except IndexError: return None try: self.date = find_token(TokenTransactionDate).date except AttributeError: raise TransactionLexingError("no transaction date in transaction") try: self.secondary_date = find_token( TokenTransactionSecondaryDate ).date except AttributeError: self.secondary_date = None if find_token(TokenTransactionClearedFlag): self.state = STATE_CLEARED elif find_token(TokenTransactionPendingFlag): self.state = STATE_PENDING else: self.state = STATE_UNCLEARED if self.state != STATE_UNCLEARED: self.clearing_date = ( self.secondary_date if self.secondary_date else self.date ) else: self.clearing_date = None try: self.payee = find_token(TokenTransactionPayee).payee except AttributeError: raise TransactionLexingError("no payee in transaction") accountsamounts = [ t for t in lexer.tokens if isinstance(t, TokenTransactionPostingAccount) or isinstance(t, TokenTransactionPostingAmount) ] x = [] last = None for v in accountsamounts: if isinstance(v, TokenTransactionPostingAccount): assert type(last) in [ type(None), TokenTransactionPostingAmount ], lexer.tokens elif isinstance(v, TokenTransactionPostingAmount): assert type(last) in [ TokenTransactionPostingAccount ], lexer.tokens x.append( ledgerhelpers.TransactionPosting( last.account, v.amount ) ) last = v assert len(x) * 2 == len(accountsamounts), lexer.tokens self.postings = x class TokenTransactionWithContext(TokenTransaction): def __init__(self, pos, tokens): self.transaction = [ t for t in tokens if isinstance(t, TokenTransaction) ][0] self.pos = pos self.contents = "".join(t.contents for t in tokens) @property def date(self): return self.transaction.date class TokenConversion(Token): pass class TokenPrice(Token): pass class TokenEmbeddedPython(Token): pass class TokenTransactionPostingAccount(Token): def __init__(self, pos, contents): Token.__init__(self, pos, contents) self.account = ''.join(contents) class TokenTransactionPostingAmount(Token): def __init__(self, pos, contents): Token.__init__(self, pos, contents) self.amount = ''.join(contents) class TokenEmbeddedTag(Token): pass class TokenTransactionDate(Token): def __init__(self, pos, contents): Token.__init__(self, pos, contents) self.date = parse_date_from_transaction_contents(self.contents) class TokenTransactionSecondaryDate(Token): def __init__(self, pos, contents): Token.__init__(self, pos, contents) self.date = parse_date_from_transaction_contents(self.contents) class TokenTransactionPayee(Token): def __init__(self, pos, contents): Token.__init__(self, pos, contents) self.payee = ''.join(contents) class LexingError(Exception): pass class TransactionLexingError(Exception): pass class EOF(LexingError): pass class GenericLexer(object): def __init__(self, items): if isinstance(items, str) and not isinstance(items, str): self.items = tuple(items.decode("utf-8")) else: self.items = tuple(items) self.start = 0 self.pos = 0 self._last_emitted_pos = self.pos self.tokens = [] def __next__(self): """Returns the item at the current position, and advances the position.""" try: t = self.items[self.pos] except IndexError: raise EOF() self.pos += 1 return t def peek(self): """Returns the item at the current position.""" try: t = self.items[self.pos] except IndexError: raise EOF() return t def confirm_next(self, seq): """Returns True if each item in seq matches each corresponding item from the current position onward.""" for n, i in enumerate(seq): try: if self.items[self.pos + n] != i: return False except IndexError: return False return True def emit(self, klass, items): """Creates an instance of klass (a Token class) with the current position and the supplied items as parameters, then accumulates the instance into the self.tokens accumulator.""" token = klass(self.pos, items) self._last_emitted_pos = self.pos self.tokens += [token] def more(self): return self.pos < len(self.items) class LedgerTextLexer(GenericLexer): def __init__(self, text): assert isinstance(text, str), type(text) GenericLexer.__init__(self, text) def state_parsing_toplevel_text(self): """Returns another state function.""" chars = [] while self.more(): if self.peek() in CHAR_COMMENT: self.emit(TokenWhitespace, chars) return self.state_parsing_comment if self.peek() in CHAR_NUMBER: self.emit(TokenWhitespace, chars) return self.state_parsing_transaction if self.confirm_next("P"): self.emit(TokenWhitespace, chars) return self.state_parsing_price if self.confirm_next("C"): self.emit(TokenWhitespace, chars) return self.state_parsing_conversion if self.confirm_next("python"): self.emit(TokenWhitespace, chars) return self.state_parsing_embedded_python if self.confirm_next("tag"): self.emit(TokenWhitespace, chars) return self.state_parsing_embedded_tag if self.peek() not in CHAR_WHITESPACE + CHAR_ENTER: _, _, l2, c2 = self._coords() raise LexingError( "unparsable data at line %d, char %d" % (l2, c2) ) chars += [next(self)] self.emit(TokenWhitespace, chars) return def state_parsing_comment(self): chars = [next(self)] while self.more(): if chars[-1] in CHAR_ENTER and self.peek() not in CHAR_COMMENT: break chars.append(next(self)) self.emit(TokenComment, chars) return self.state_parsing_toplevel_text def state_parsing_price(self): return self.state_parsing_embedded_directive(TokenPrice, False) def state_parsing_conversion(self): return self.state_parsing_embedded_directive(TokenConversion, False) def state_parsing_embedded_tag(self): return self.state_parsing_embedded_directive(TokenEmbeddedTag) def state_parsing_embedded_python(self): return self.state_parsing_embedded_directive(TokenEmbeddedPython) def state_parsing_embedded_directive(self, klass, maybe_multiline=True): chars = [next(self)] while self.more(): if chars[-1] in CHAR_ENTER: if not maybe_multiline: break if self.peek() in CHAR_WHITESPACE + CHAR_ENTER: chars.append(next(self)) continue if self.peek() in CHAR_COMMENT: self.emit(klass, chars) return self.state_parsing_comment if self.peek() in CHAR_NUMBER: self.emit(klass, chars) return self.state_parsing_transaction self.emit(klass, chars) return self.state_parsing_toplevel_text chars.append(next(self)) self.emit(klass, chars) return self.state_parsing_toplevel_text def state_parsing_transaction(self): chars = [next(self)] while self.more(): if chars[-1] in CHAR_ENTER and self.peek() not in CHAR_WHITESPACE: break chars.append(next(self)) self.emit(TokenTransaction, chars) return self.state_parsing_toplevel_text def _coords(self): r, c = pos_within_items_to_row_and_col(self._last_emitted_pos, self.items) r2, c2 = pos_within_items_to_row_and_col(self.pos, self.items) return r, c, r2, c2 def run(self): state = self.state_parsing_toplevel_text while state: try: state = state() except LexingError: raise except Exception as e: l, c, l2, c2 = self._coords() raise LexingError( "bad ledger data between line %d, char %d and line %d, char %d: %s" % ( l, c, l2, c2, e ) ) class LedgerTransactionLexer(GenericLexer): def __init__(self, text): GenericLexer.__init__(self, text) def state_parsing_transaction_date(self): chars = [] while self.more(): if self.peek() not in "0123456789-/": self.emit(TokenTransactionDate, chars) if self.confirm_next("="): next(self) return self.state_parsing_clearing_date elif self.peek() in CHAR_WHITESPACE: return self.state_parsing_cleared_flag_or_payee else: raise TransactionLexingError("invalid character %s" % self.peek()) chars += [next(self)] raise TransactionLexingError("incomplete transaction") def state_parsing_clearing_date(self): chars = [] while self.more(): if self.peek() not in "0123456789-/": next(self) self.emit(TokenTransactionSecondaryDate, chars) return self.state_parsing_cleared_flag_or_payee chars += [next(self)] raise TransactionLexingError("incomplete transaction") def state_parsing_cleared_flag_or_payee(self): while self.more(): if self.peek() in CHAR_WHITESPACE: next(self) continue if self.peek() in CHAR_ENTER: break if self.confirm_next(CHAR_CLEARED): self.emit(TokenTransactionClearedFlag, [next(self)]) return self.state_parsing_payee if self.confirm_next(CHAR_PENDING): self.emit(TokenTransactionPendingFlag, [next(self)]) return self.state_parsing_payee return self.state_parsing_payee raise TransactionLexingError("incomplete transaction") def state_parsing_payee(self): return self.state_parsing_rest_of_line( TokenTransactionPayee, self.state_parsing_transaction_posting_indentation) def state_parsing_rest_of_line( self, klass, next_state, allow_empty_values=False ): chars = [] while self.more(): if self.peek() in CHAR_ENTER: next(self) while chars and chars[-1] in CHAR_WHITESPACE: chars = chars[:-1] break if self.peek() in CHAR_WHITESPACE and not chars: next(self) continue chars.append(next(self)) if allow_empty_values or chars: self.emit(klass, chars) return next_state raise TransactionLexingError("incomplete transaction") def state_parsing_transaction_posting_indentation(self): chars = [] while self.more(): if self.peek() not in CHAR_WHITESPACE: break chars.append(next(self)) if not chars: return if self.more() and self.peek() in CHAR_ENTER: next(self) return self.state_parsing_transaction_posting_indentation return self.state_parsing_transaction_posting_account def state_parsing_transaction_comment(self): return self.state_parsing_rest_of_line( TokenTransactionComment, self.state_parsing_transaction_posting_indentation) def state_parsing_transaction_posting_account(self): chars = [] if self.more() and self.peek() in CHAR_COMMENT: return self.state_parsing_transaction_comment while self.more(): if ( (self.peek() in CHAR_WHITESPACE and chars and chars[-1] in CHAR_WHITESPACE) or self.peek() in CHAR_TAB or self.peek() in CHAR_ENTER ): while chars[-1] in CHAR_WHITESPACE: chars = chars[:-1] break chars.append(next(self)) if not chars: raise TransactionLexingError("truncated transaction posting") self.emit(TokenTransactionPostingAccount, chars) return self.state_parsing_transaction_posting_amount def state_parsing_transaction_posting_amount(self): return self.state_parsing_rest_of_line( TokenTransactionPostingAmount, self.state_parsing_transaction_posting_indentation, allow_empty_values=True) def run(self): state = self.state_parsing_transaction_date while state: state = state() class LedgerContextualLexer(GenericLexer): def state_parsing_toplevel(self): while self.more(): if isinstance(self.peek(), TokenComment): return self.state_parsing_comment token = next(self) self.emit(token.__class__, token.contents) def state_parsing_comment(self): token = next(self) if ( self.more() and isinstance(token, TokenComment) and isinstance(self.peek(), TokenTransaction) ): transaction_token = next(self) additional_comments = [] while self.more() and isinstance(self.peek(), TokenComment): additional_comments.append(next(self)) self.emit(TokenTransactionWithContext, [token, transaction_token] + additional_comments) else: self.emit(token.__class__, token.contents) return self.state_parsing_toplevel def run(self): state = self.state_parsing_toplevel while state: try: state = state() except LexingError: raise except Exception as e: raise LexingError( "error parsing ledger data between chunk %d and chunk %d): %s" % ( self._last_emitted_pos, self.pos, e ) ) def lex_ledger_file_contents(text, debug=False): lexer = LedgerTextLexer(text) lexer.run() concat_lexed = "".join([x.contents for x in lexer.tokens]) if concat_lexed != text: if debug: u = "Debugging error lexing text: files differ\n\n" diffing.two_way_diff(u + text, u + concat_lexed) raise LexingError("the lexed contents and the original contents are not the same") lexer = LedgerContextualLexer(lexer.tokens) lexer.run() concat_lexed = "".join([ x.contents for x in lexer.tokens ]) if concat_lexed != text: if debug: u = "Debugging error lexing chunks: files differ\n\n" diffing.two_way_diff(u + text, u + concat_lexed) raise LexingError("the lexed chunks and the original chunks are not the same") return lexer.tokens ledgerhelpers-0.3.10/src/ledgerhelpers/programs/000077500000000000000000000000001434235220400216655ustar00rootroot00000000000000ledgerhelpers-0.3.10/src/ledgerhelpers/programs/__init__.py000066400000000000000000000000001434235220400237640ustar00rootroot00000000000000ledgerhelpers-0.3.10/src/ledgerhelpers/programs/addtrans.py000077500000000000000000000204551434235220400240500ustar00rootroot00000000000000#!/usr/bin/python3 import argparse import datetime import logging import traceback import gi gi.require_version("Gtk", "3.0") from gi.repository import GObject from gi.repository import Gtk from gi.repository import Pango import ledgerhelpers as common from ledgerhelpers import gui from ledgerhelpers import journal from ledgerhelpers.programs import common as common_programs import ledgerhelpers.editabletransactionview as ed ASYNC_LOAD_MESSAGE = "Loading completion data from your ledger..." ASYNC_LOADING_ACCOUNTS_MESSAGE = ( "Loading account and commodity data from your ledger..." ) class AddTransWindow(Gtk.Window, gui.EscapeHandlingMixin): def __init__(self): Gtk.Window.__init__(self, title="Add transaction") self.set_border_width(12) grid = Gtk.Grid() grid.set_column_spacing(8) grid.set_row_spacing(12) self.add(grid) row = 0 self.transholder = ed.EditableTransactionView() grid.attach(self.transholder, 0, row, 2, 1) row += 1 self.transaction_view = gui.LedgerTransactionView() self.transaction_view.set_vexpand(True) self.transaction_view.get_accessible().set_name("Transaction preview") grid.attach(self.transaction_view, 0, row, 2, 1) row += 1 self.status = Gtk.Label() self.status.set_line_wrap(True) self.status.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) self.status.set_hexpand(True) grid.attach(self.status, 0, row, 1, 1) button_box = Gtk.ButtonBox() button_box.set_layout(Gtk.ButtonBoxStyle.END) button_box.set_spacing(12) button_box.set_hexpand(False) self.close_button = Gtk.Button(stock=Gtk.STOCK_CLOSE) button_box.add(self.close_button) self.add_button = Gtk.Button(stock=Gtk.STOCK_ADD) button_box.add(self.add_button) grid.attach(button_box, 1, row, 1, 1) self.add_button.set_can_default(True) self.add_button.grab_default() class AddTransApp(AddTransWindow, gui.EscapeHandlingMixin): logger = logging.getLogger("addtrans") internal_parsing = [] def __init__(self, journal, preferences): AddTransWindow.__init__(self) self.journal = journal self.preferences = preferences self.successfully_loaded_accounts_and_commodities = False self.accounts = [] self.commodities = dict() self.internal_parsing = [] self.payees = [] self.activate_escape_handling() self.close_button.connect("clicked", lambda _: self.emit('delete-event', None)) self.add_button.connect("clicked", lambda _: self.process_transaction()) date = self.preferences.get("last_date", datetime.date.today()) self.transholder.set_transaction_date(date) self.transholder.connect( "payee-changed", self.payee_changed ) self.transholder.connect( "changed", self.update_transaction_view ) self.add_button.set_sensitive(False) self.transholder.title_grab_focus() self.status.set_text(ASYNC_LOAD_MESSAGE) self.connect("delete-event", lambda _, _a: self.save_preferences()) self.reload_completion_data() def reload_completion_data(self): gui.g_async( lambda: self.journal.internal_parsing(), lambda payees: self.internal_parsing_loaded(payees), self.journal_load_failed, ) def internal_parsing_loaded(self, internal_parsing): self.internal_parsing = internal_parsing gui.g_async( lambda: self.journal.all_payees(), lambda payees: self.all_payees_loaded(payees), self.journal_load_failed, ) def all_payees_loaded(self, payees): self.payees = payees self.transholder.set_payees_for_completion(self.payees) gui.g_async( lambda: self.journal.accounts_and_last_commodity_for_account(), lambda r: self.accounts_and_last_commodities_loaded(*r), self.journal_load_failed, ) if self.status.get_text() == ASYNC_LOAD_MESSAGE: self.status.set_text(ASYNC_LOADING_ACCOUNTS_MESSAGE) def accounts_and_last_commodities_loaded(self, accounts, last_commos): self.accounts = accounts self.commodities = last_commos self.transholder.set_accounts_for_completion(self.accounts) self.transholder.set_default_commodity_getter( self.get_commodity_for_account ) self.successfully_loaded_accounts_and_commodities = True if self.status.get_text() == ASYNC_LOADING_ACCOUNTS_MESSAGE: self.status.set_text("") def journal_load_failed(self, e): traceback.print_exception(e) gui.FatalError( "Add transaction loading failed", "An unexpected error took place:\n%s" % e, ) self.emit('delete-event', None) def get_commodity_for_account(self, account_name): try: return self.commodities[account_name] except KeyError: pass def payee_changed(self, emitter=None): if emitter.postings_modified() and not emitter.postings_empty(): return text = emitter.get_payee_text() self.try_autofill(emitter, text) def try_autofill(self, transaction_view, autofill_text): ts = journal.transactions_with_payee( autofill_text, self.internal_parsing, case_sensitive=False ) if not ts: return return self.autofill_transaction_view(transaction_view, ts[-1]) def autofill_transaction_view(self, transaction_view, transaction): transaction_view.replace_postings(transaction.postings) transaction_view.set_clearing(transaction.state) def update_transaction_view(self, unused_ignored=None): self.update_validation() k = self.transholder.get_data_for_transaction_record title, date, clear, statechar, lines = k() self.transaction_view.generate_record( title, date, clear, statechar, lines ) def update_validation(self, grab_focus=False): try: self.transholder.validate(grab_focus=grab_focus) self.status.set_text("") self.add_button.set_sensitive(True) return True except common.TransactionInputValidationError as e: self.status.set_text(str(e)) self.add_button.set_sensitive(False) return False def process_transaction(self): if not self.update_validation(True): return buf = self.transaction_view.get_buffer() text = buf.get_text(buf.get_start_iter(), buf.get_end_iter(), True) self.journal.add_text_to_file(text) self.reset_after_save() def reset_after_save(self): self.transholder.clear() self.transholder.title_grab_focus() self.status.set_text("Transaction saved") self.reload_completion_data() def save_preferences(self): if not self.successfully_loaded_accounts_and_commodities: return self.preferences["default_to_clearing"] = ( self.transholder.clearing.get_state() != self.transholder.clearing.STATE_UNCLEARED ) if self.transholder.when.get_date() in (datetime.date.today(), None): del self.preferences["last_date"] else: self.preferences["last_date"] = ( self.transholder.when.get_date() ) self.preferences.persist() def get_argparser(): parser = argparse.ArgumentParser( 'Add new transactions to your Ledger file', parents=[common_programs.get_common_argparser()] ) parser.add_argument('--debug', dest='debug', action='store_true', help='activate debugging') return parser def main(): args = get_argparser().parse_args() common.enable_debugging(args.debug) GObject.threads_init() journal, s = gui.load_journal_and_settings_for_gui( ledger_file=args.file, price_file=args.pricedb, ) klass = AddTransApp win = klass(journal, s) win.connect("delete-event", Gtk.main_quit) GObject.idle_add(win.show_all) Gtk.main() ledgerhelpers-0.3.10/src/ledgerhelpers/programs/cleartranscli.py000077500000000000000000000046131434235220400250740ustar00rootroot00000000000000#!/usr/bin/python3 import datetime import os import re import sys sys.path.append(os.path.dirname(__file__)) import ledgerhelpers.legacy as common from ledgerhelpers import gui date_re = "^([0-9][0-9][0-9][0-9].[0-9][0-9].[0-9][0-9])(=[0-9][0-9][0-9][0-9].[0-9][0-9].[0-9][0-9]|)\\s+(.+)" date_re = re.compile(date_re, re.RegexFlag.DOTALL) def clear(f): changed = False lines = open(f).readlines() for n, line in enumerate(lines): m = date_re.match(line) if not m: continue if m.group(3).strip().startswith("*"): continue lines_to_write = [line] originaln = n while True: n = n + 1 try: nextline = lines[n] except IndexError: break if nextline.startswith(" ") or nextline.startswith("\t"): lines_to_write.append(nextline) else: break initial_unparsed = m.group(2)[1:] if m.group(2) else m.group(1) initial = common.parse_date(initial_unparsed) if initial > datetime.date.today(): continue for line in lines_to_write: sys.stdout.write(line) sys.stdout.flush() choice = common.prompt_for_date_optional( sys.stdin, sys.stdout, "Mark cleared at this date?", initial, ) if choice is not None: choice_formatted = common.format_date(choice, initial_unparsed) if m.group(1) == choice_formatted: lines[originaln] = "%s * %s" % ( m.group(1), m.group(3) ) else: lines[originaln] = "%s=%s * %s" % ( m.group(1), choice_formatted, m.group(3) ) for number in range(originaln + 1, n): # remove cleared bits on legs of the transaction lines[number] = re.sub("^(\\s+)\\*\\s+", "\\1", lines[number]) changed = True else: pass if changed: y = open(f + ".new", "w") y.write("".join(lines)) y.flush() try: os.rename(f + ".new", f) except Exception: os.unlink(f + ".new") raise def main(): ledger_file = gui.find_ledger_file_for_gui() return clear(ledger_file) ledgerhelpers-0.3.10/src/ledgerhelpers/programs/common.py000066400000000000000000000006521434235220400235320ustar00rootroot00000000000000#!/usr/bin/python3 import argparse def get_common_argparser(): parser = argparse.ArgumentParser(add_help=False) parser.add_argument('--file', dest='file', action='store', help='specify path to ledger file to work with') parser.add_argument('--price-db', dest='pricedb', action='store', help='specify path to ledger price database to work with') return parser ledgerhelpers-0.3.10/src/ledgerhelpers/programs/sellstockcli.py000077500000000000000000000151531434235220400247420ustar00rootroot00000000000000#!/usr/bin/python3 import datetime import fnmatch import ledger import re import subprocess import sys import ledgerhelpers.legacy as common from ledgerhelpers import gui class Lot(object): def __init__(self, number, date, amount, acct): self.number = number self.date = date self.amount = amount quantity = ledger.Amount(amount.strip_annotations()) self.price = self.amount.price() / quantity self.account = acct def __str__(self): return ( "" ) % ( self.number, self.amount, self.price, self.account, self.date ) class NotEnough(Exception): pass class Lots(object): def __init__(self): self.lots = [] self.unfinished = [] def __getitem__(self, idx): return list(self)[idx] def __iter__(self): return iter(sorted( self.lots, key=lambda l: "%s" % (l.date,) )) def parse_ledger_bal(self, text): """Demands '--balance-format=++ %(account)\n%(amount)\n' format. Demands '--date-format=%Y-%m-%d' date format.""" lines = [x.strip() for x in text.splitlines() if x.strip()] account = None for line in lines: if line.startswith("++ "): account = line[3:] else: amount = ledger.Amount(line) date = re.findall(r'\[\d\d\d\d-\d\d-\d\d]', line) assert len(date) < 2 if date: date = common.parse_date(date[0][1:-1]) else: date = None try: lot = Lot(self.nextnum(), date, amount, account) self.lots.append(lot) except TypeError: # At this point, we know the commodity does not have a price. # So we ignore this. pass def nextnum(self): if not self.lots: return 1 return max([l.number for l in self.lots]) + 1 def first_lot_by_commodity(self, commodity): return [s for s in self if str(s.amount.commodity) == str(commodity)][0] def subtract(self, amount): lots = [] subtracted = amount - amount while subtracted < amount: try: l = self.first_lot_by_commodity(amount.commodity) except IndexError: raise NotEnough(amount - subtracted) to_reduce = min([l.amount.strip_annotations(), amount - subtracted]) if str(to_reduce) == str(l.amount.strip_annotations()): lots.append(l) self.lots.remove(l) else: l.amount -= to_reduce.number() new_amount = l.amount - l.amount + to_reduce.number() lots.append(Lot(l.number, l.date, new_amount, l.account)) subtracted += to_reduce return lots def matches(string, options): for option in options: if fnmatch.fnmatch(string, option): return True return False def main(): journal, s = gui.load_journal_and_settings_for_gui() accts, unused_commodities = journal.accounts_and_last_commodity_for_account() saleacct = common.prompt_for_account( sys.stdin, sys.stdout, accts, "Which account was the sold commodity stored in?", s.get("last_sellstock_account", None) ) assert saleacct, "Not an account: %s" % saleacct s["last_sellstock_account"] = saleacct commissionsaccount = common.prompt_for_account( sys.stdin, sys.stdout, accts, "Which account to account for commissions?", s.get("last_commissions_account", None) ) assert commissionsaccount, "Not an account: %s" % commissionsaccount s["last_commissions_account"] = commissionsaccount gainslossesacct = common.prompt_for_account( sys.stdin, sys.stdout, accts, "Which account to credit gains and losses?", s.get("last_gainslosses_account", "Capital:Recognized gains and losses") ) assert gainslossesacct, "Not an account: %s" % gainslossesacct s["last_gainslosses_account"] = gainslossesacct target_amount = common.prompt_for_amount( sys.stdin, sys.stdout, "How many units of what commodity?", ledger.Amount("$ 1") ) target_sale_price = common.prompt_for_amount( sys.stdin, sys.stdout, "What is the sale price of the commodity?", ledger.Amount("$ 1") ) commission = common.prompt_for_amount( sys.stdin, sys.stdout, "What was the commission of the trade?", ledger.Amount("$ 1") ) all_lots = Lots() lots_text = subprocess.check_output([ 'ledger', 'bal', '--lots', '--lot-dates', '--lot-prices', '--date-format=%Y-%m-%d', '--sort=date', '--balance-format=++ %(account)\n%(amount)\n', saleacct ]) all_lots.parse_ledger_bal(lots_text) print("=========== Read ===========") for l in all_lots: print(l) lots_produced = all_lots.subtract(target_amount) print("========= Computed =========") for l in lots_produced: print(l) print("=========== Left ===========") for l in all_lots: print(l) lines = [] tpl = "%s {%s}%s @ %s" datetpl = ' [%s]' for l in lots_produced: m = -1 * l.amount if m.commodity.details.date: datetext = datetpl % m.commodity.details.date.strftime("%Y-%m-%d") else: datetext = '' lines.append(( l.account, tpl % (m.strip_annotations(), m.commodity.details.price, datetext, target_sale_price) )) diff = (l.price - target_sale_price) * l.amount lines.append((gainslossesacct, diff)) totalsale = target_sale_price * sum( l.amount.number() for l in lots_produced ) lines.append((saleacct, totalsale - commission)) lines.append((commissionsaccount, commission)) lines = journal.generate_record( "Sale of %s" % (target_amount), datetime.date.today(), None, "", lines, ) print("========== Record ==========") print("\n".join(lines)) save = common.yesno( sys.stdin, sys.stderr, "Hit ENTER or y to save it to the file, BACKSPACE or n to skip saving: " ) if save: journal.add_text_to_file(lines) ledgerhelpers-0.3.10/src/ledgerhelpers/programs/sorttranscli.py000066400000000000000000000054431434235220400247740ustar00rootroot00000000000000#!/usr/bin/python3 import argparse import codecs import collections import datetime import itertools import subprocess import sys from ledgerhelpers import diffing from ledgerhelpers import parser from ledgerhelpers import gui from ledgerhelpers.programs import common as common_programs def get_argparser(): parser = argparse.ArgumentParser( 'Sort transactions in a ledger file chronologically', parents=[common_programs.get_common_argparser()] ) parser.add_argument('-y', dest='assume_yes', action='store_true', help='record changes immediately, instead of ' 'showing a three-way diff for you to resolve') parser.add_argument('--debug', dest='debug', action='store_true', help='do not capture exceptions into a dialog box') return parser def sort_transactions(items): smallest_date = datetime.date(1000, 1, 1) largest_date = datetime.date(3000, 1, 1) bydates = collections.OrderedDict() first_transaction_seen = False for n, item in enumerate(items): if hasattr(item, "date"): first_transaction_seen = True if first_transaction_seen: later_dates = itertools.chain( (getattr(items[i], "date", None) for i in range(n, len(items))), [largest_date] ) for date in later_dates: if date is not None: break else: date = smallest_date if date not in bydates: bydates[date] = [] bydates[date] += [item] for date in sorted(bydates): for item in bydates[date]: yield item def main(argv): p = get_argparser() args = p.parse_args(argv[1:]) if args.file: ledgerfile = args.file else: ledgerfile = gui.find_ledger_file_for_gui() try: leftcontents = codecs.open(ledgerfile, "rb", "utf-8").read() items = parser.lex_ledger_file_contents(leftcontents, debug=args.debug) rightcontents = "".join(i.contents for i in sort_transactions(items)) if args.assume_yes: with open(ledgerfile, "w") as out_file: out_file.write(rightcontents) return 0 try: diffing.three_way_diff(ledgerfile, leftcontents, rightcontents) except subprocess.CalledProcessError as e: if args.debug: raise print("Meld failed", file=sys.stderr) print("Meld process failed with return code %s" % e.returncode, file=sys.stderr) return e.returncode except Exception as e: if args.debug: raise print("Transaction sort failed", file=sys.stderr) print("An unexpected error took place:\n%s" % e, file=sys.stderr) return 9 ledgerhelpers-0.3.10/src/ledgerhelpers/programs/updateprices.py000066400000000000000000000640301434235220400247320ustar00rootroot00000000000000#!/usr/bin/python3 import argparse import collections import datetime import http.client import json import ledger import ledgerhelpers from ledgerhelpers import gui import threading import traceback import urllib.parse import sys import yahoo_finance import gi gi.require_version("Gtk", "3.0") from gi.repository import GObject from gi.repository import Gtk def get_argparser(): parser = argparse.ArgumentParser( 'Update prices in a Ledger price file' ) parser.add_argument('-b', dest='batch', action='store_true', help='update price file in batch (non-GUI) mode') parser.add_argument('--debug', dest='debug', action='store_true', help='do not capture exceptions into a dialog box') return parser class QuoteSource(object): pass class DontQuote(QuoteSource): def __str__(self): return "skip quoting" def get_quote(self, commodity, denominated_in): # @UnusedVariable return None, None class YahooFinanceCommodities(QuoteSource): def __str__(self): return "Yahoo! Finance commodities" def get_quote( self, commodity, denominated_in, commodity_is_currency_pair=False ): """Returns the price in the appraised_as currency, and the datetime. Args: commodity: a Ledger commodity representing a non-currency commodity denominated_in: a Ledger commodity Returns: price: ledger.Amount instance datetime: datetime.datetime instance """ if not isinstance(commodity, ledger.Commodity): raise ValueError("commodity must be a Ledger commodity") if not isinstance(denominated_in, ledger.Commodity): raise ValueError("denominated_in must be a Ledger commodity") if commodity_is_currency_pair: source = str(commodity) source = source if source != "$" else "USD" target = str(denominated_in) target = target if target != "$" else "USD" pair = source + target s = yahoo_finance.Currency(pair) try: price, date = s.get_rate(), s.get_trade_datetime() except KeyError: raise ValueError( "Yahoo! Finance can't find currency pair %s" % pair ) else: if str(denominated_in) not in ["$", "USD"]: raise ValueError( "Yahoo! Finance can't quote in %s" % denominated_in ) s = yahoo_finance.Share(str(commodity)) try: price, date = s.get_price(), s.get_trade_datetime() except KeyError: raise ValueError( "Yahoo! Finance can't find commodity %s" % commodity ) a = ledger.Amount(price) a.commodity = denominated_in d = datetime.datetime.strptime( date, '%Y-%m-%d %H:%M:%S UTC+0000' ) return a, d class YahooFinanceCurrencies(YahooFinanceCommodities): def __str__(self): return "Yahoo! Finance currencies" def get_quote(self, commodity, denominated_in="$"): """Returns the price in the appraised_as currency, and the datetime. Args: commodity: a Ledger commodity representing a currency denominated_in: a Ledger commodity Returns: price: ledger.Amount instance datetime: datetime.datetime instance """ return YahooFinanceCommodities.get_quote( self, commodity, denominated_in, commodity_is_currency_pair=True ) def json_from_uri(uri): c = http.client.HTTPSConnection(urllib.parse.urlsplit(uri).netloc) # @UndefinedVariable c.request('GET', uri) response = c.getresponse().read() try: return json.loads(response) except ValueError: raise ValueError("JSON object undecodable: %s" % response) class BitcoinCharts(QuoteSource): def __str__(self): return "bitcoin charts" def get_quote(self, commodity, denominated_in): """Returns the price in the denominated_in currency, and the datetime. Args: commodity: a Ledger commodity denominated_in: a Ledger commodity Returns: price: ledger.Amount instance datetime: datetime.datetime instance """ if not isinstance(commodity, ledger.Commodity): raise ValueError("commodity must be a Ledger commodity") if not isinstance(denominated_in, ledger.Commodity): raise ValueError("denominated_in must be a Ledger commodity") if str(commodity) not in ["BTC", "XBT"]: raise ValueError( "bitcoin charts can only provide quotes for BTC / XBT" ) data = json_from_uri( "https://api.bitcoincharts.com/v1/weighted_prices.json" ) try: k = "USD" if str(denominated_in) == "$" else str(denominated_in) amount = data[k].get("24h", data[k]["7d"]) except KeyError: raise ValueError( "bitcoin charts can't provide quotes in %s" % denominated_in ) a = ledger.Amount(amount) a.commodity = denominated_in d = datetime.datetime.now() return a, d class PriceGatheringDatabase(Gtk.ListStore): def __init__(self): # Columns: # 0: Ledger.commodity to appraise # 1: data source to fetch prices from # 2: list of (Ledger.commodity) representing which denominations # the (0) commodity must be appraised in # 3: list of (gathered price, datetime) # 4: errors (exceptions) Gtk.ListStore.__init__(self, object, object, object, object, object) self.commodities_added = dict() def add_to_gather_list(self, commodity, datasource, fetch_prices_in): if self.commodities_added.get(str(commodity)): return if isinstance(commodity, ledger.Amount): commodity = commodity.commodity assert isinstance(commodity, ledger.Commodity), commodity assert isinstance(datasource, QuoteSource) for f in fetch_prices_in: assert isinstance(f, ledger.Commodity) self.append((commodity, datasource, list(fetch_prices_in), list(), list())) self.commodities_added[str(commodity)] = True def clear_gathered(self): for row in self: while row[3]: row[3].pop() while row[4]: row[4].pop() self.emit('row-changed', row.path, row.iter) def record_gathered(self, commodity, amount, timeobject): assert isinstance(commodity, ledger.Commodity), commodity assert isinstance(amount, ledger.Amount), amount found = False for row in self: if commodity == row[0]: found = True break assert found, "%s not found in gather list" % commodity row[3].append((amount, timeobject)) self.emit('row-changed', row.path, row.iter) def record_gathered_error(self, commodity, error): assert isinstance(commodity, ledger.Commodity), commodity found = False for row in self: if commodity == row[0]: found = True break assert found, "%s not found in gather list" % commodity row[4].append(error) self.emit('row-changed', row.path, row.iter) def get_currency_by_path(self, treepath): it = self.get_iter(treepath) return self.get_value(it, 0) def update_quoter(self, treepath, new_datasource): i = self.get_iter(treepath) self.set_value(i, 1, new_datasource) def update_price_in(self, treepath, new_price_in): i = self.get_iter(treepath) self.set_value(i, 2, new_price_in) def get_prices(self): for row in self: for p, d in row[3]: yield row[0], p, d def get_errors(self): for row in self: for e in row[4]: yield row[0], e @GObject.type_register class PriceGatherer(GObject.GObject): __gsignals__ = { "gathering-started": ( GObject.SIGNAL_RUN_LAST, None, () ), "gathering-done": ( GObject.SIGNAL_RUN_LAST, None, () ), } def __init__(self, quoters): GObject.GObject.__init__(self) assert quoters self.quoters = quoters self.database = PriceGatheringDatabase() def load_commodities_from_journal( self, journal, map_from_currencystrs_to_quotesources, map_from_currencystrs_to_priceins, ): DontQuote = self.quoters.get("DontQuote", list(self.quoters.values())[0]) default = "$" coms = [c.strip_annotations().commodity for c in journal.commodities()] strcoms = [str(c) for c in coms] if "USD" in strcoms and "$" not in strcoms: default = "USD" already = dict() for c in coms: if str(c) in already: continue already[str(c)] = True quoter = list(self.quoters.values())[0] if str(c) in ["USD", "$"] and default in ["USD", "$"]: quoter = DontQuote if str(c) in map_from_currencystrs_to_quotesources: quoter = map_from_currencystrs_to_quotesources[str(c)] quoteins = [journal.commodity(default)] if str(c) in map_from_currencystrs_to_priceins: quoteins = list(map_from_currencystrs_to_priceins[str(c)]) self.database.add_to_gather_list( c, quoter, quoteins, ) def _gather_inner(self, sync=False): def do(f, *a): if not sync: return GObject.idle_add(f, *a) return f(*a) do(self.database.clear_gathered) for row in self.database: commodity = row[0] quotesource = row[1] for denominated_in in row[2]: try: price, time = quotesource.get_quote( commodity, denominated_in=denominated_in ) if price is None and time is None: continue do( self.database.record_gathered, commodity, price, time ) except Exception as e: error = str(e) do( self.database.record_gathered_error, commodity, error, ) traceback.print_exc() GObject.idle_add(self.emit, "gathering-done") def gather_quotes(self, sync=False): GObject.idle_add(self.emit, "gathering-started") if not sync: t = threading.Thread(target=self._gather_inner) t.setDaemon(True) t.start() else: return self._gather_inner(sync=True) @GObject.type_register class CellRendererCommodity(Gtk.CellRendererText): __gproperties__ = { "commodity": ( GObject.TYPE_PYOBJECT, "commodity to display", "the commodity to render in the cell", GObject.PARAM_READWRITE ) } def do_set_property(self, prop, val): if prop.name == "commodity": self.set_property("text", str(val)) else: self.set_property(prop, val) @GObject.type_register class CellRendererQuoteSource(Gtk.CellRendererCombo): __gproperties__ = { "source": ( GObject.TYPE_PYOBJECT, "source of quotes", "the QuoteSource data source to render", GObject.PARAM_READWRITE ) } def do_set_property(self, prop, val): if prop.name == "source": self.set_property("text", str(val)) else: self.set_property(prop, val) @GObject.type_register class CellRendererPriceIn(Gtk.CellRendererText): __gproperties__ = { "price-in": ( GObject.TYPE_PYOBJECT, "which commodities to denominate the quotes in", "list of denominations for quote fetches", GObject.PARAM_READWRITE ) } def do_set_property(self, prop, val): if prop.name == "price-in": self.set_property("text", "\n".join(str(s) for s in val)) else: self.set_property(prop, val) @GObject.type_register class CellRendererFetchedList(Gtk.CellRendererText): render_datum = 0 __gproperties__ = { "list": ( GObject.TYPE_PYOBJECT, "list to display", "the list of fetched quotes to render", GObject.PARAM_READWRITE ), "render-datum": ( GObject.TYPE_INT, "which datum to render", "render either 0 for price or 1 for time", render_datum, 1, 0, GObject.PARAM_READWRITE ), } def do_get_property(self, prop): if prop.name == "render-datum": return self.render_datum else: assert 0, prop def do_set_property(self, prop, val): def render(obj): if self.render_datum != 1: return str(obj) else: return obj.strftime("%Y-%m-%d %H:%M:%S") if prop.name == "list": self.set_property( "text", "\n".join(render(p[self.render_datum]) for p in val) ) elif prop.name == "render-datum": self.render_datum = val else: assert 0, (prop, val) @GObject.type_register class CellRendererFetchErrors(Gtk.CellRendererText): __gproperties__ = { "errors": ( GObject.TYPE_PYOBJECT, "list of errors to render", "list of error strings to render", GObject.PARAM_READWRITE ) } def do_set_property(self, prop, val): if prop.name == "errors": self.set_property("text", "\n".join(str(s) for s in val)) else: self.set_property(prop, val) class PriceGatheringView(Gtk.TreeView): def __init__(self): Gtk.TreeView.__init__(self) commodity_renderer = CellRendererCommodity() commodity_renderer.set_property("yalign", 0.0) commodity_column = Gtk.TreeViewColumn( "Commodity", commodity_renderer, commodity=0, ) self.append_column(commodity_column) quotesource_renderer = CellRendererQuoteSource() quotesource_renderer.set_property("yalign", 0.0) quotesource_column = Gtk.TreeViewColumn( "Quote source", quotesource_renderer, source=1, ) self.append_column(quotesource_column) self.quotesource_renderer = quotesource_renderer price_in_renderer = CellRendererPriceIn() price_in_renderer.set_property("yalign", 0.0) price_in_column = Gtk.TreeViewColumn( "Quote in", price_in_renderer, price_in=2, ) self.append_column(price_in_column) self.price_in_renderer = price_in_renderer fetched_prices_renderer = CellRendererFetchedList() fetched_prices_renderer.set_property("yalign", 0.0) fetched_prices_renderer.set_property("render-datum", 0) fetched_prices_column = Gtk.TreeViewColumn( "Price", fetched_prices_renderer, list=3, ) self.append_column(fetched_prices_column) fetched_dates_renderer = CellRendererFetchedList() fetched_dates_renderer.set_property("yalign", 0.0) fetched_dates_renderer.set_property("render-datum", 1) fetched_dates_column = Gtk.TreeViewColumn( "Date", fetched_dates_renderer, list=3, ) self.append_column(fetched_dates_column) errors_renderer = CellRendererFetchErrors() errors_renderer.set_property("yalign", 0.0) errors_column = Gtk.TreeViewColumn( "Status", errors_renderer, errors=4, ) self.append_column(errors_column) class UpdatePricesWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="Update prices") self.set_border_width(12) self.set_default_size(800, 430) grid = Gtk.Grid() grid.set_column_spacing(8) grid.set_row_spacing(8) self.add(grid) row = 0 self.gatherer_view = PriceGatheringView() self.gatherer_view.set_hexpand(True) self.gatherer_view.set_vexpand(True) sw = Gtk.ScrolledWindow() sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) sw.set_shadow_type(Gtk.ShadowType.IN) sw.add(self.gatherer_view) grid.attach(sw, 0, row, 1, 1) row += 1 button_box = Gtk.ButtonBox() button_box.set_layout(Gtk.ButtonBoxStyle.END) button_box.set_spacing(12) self.status = Gtk.Label() button_box.add(self.status) self.close_button = Gtk.Button(stock=Gtk.STOCK_CLOSE) button_box.add(self.close_button) self.fetch_button = Gtk.Button(label="Fetch") button_box.add(self.fetch_button) self.save_button = Gtk.Button(stock=Gtk.STOCK_SAVE) button_box.add(self.save_button) grid.attach(button_box, 0, row, 2, 1) self.fetch_button.set_can_default(True) self.fetch_button.grab_default() class UpdatePricesCommon(object): def __init__(self, journal, preferences): self.journal = journal self.preferences = preferences try: self.preferences["quotesources"] except KeyError: self.preferences["quotesources"] = dict() try: self.preferences["quotecurrencies"] except KeyError: self.preferences["quotecurrencies"] = dict() self.quoters = collections.OrderedDict( (str(q), q) for q in [ YahooFinanceCommodities(), YahooFinanceCurrencies(), BitcoinCharts(), DontQuote(), ] ) self.gatherer = PriceGatherer(self.quoters) def get_ready(self): prefquotesources = dict( (cur, self.quoters.get(n, list(self.quoters.values())[0])) for cur, n in list(self.preferences["quotesources"].items()) if type(n) is not list ) prefquotecurrencies = dict( (cur, [self.journal.commodity(v, True) for v in pins]) for cur, pins in list(self.preferences["quotecurrencies"].items()) ) self.gatherer.load_commodities_from_journal( self.journal, prefquotesources, prefquotecurrencies, ) def save_fetched_prices(self): recs = list(self.gatherer.database.get_prices()) if recs: lines = self.journal.generate_price_records(recs) self.journal.add_text_to_price_file(lines) def output_errors(self): recs = list(self.gatherer.database.get_errors()) if recs: print("There were errors obtaining prices:", file=sys.stderr) for comm, error in recs: print("* Gathering %s: %s" % (comm, error)) return bool(recs) def run(self): self.get_ready() self.gatherer.gather_quotes(sync=True) errors = self.output_errors() self.save_fetched_prices() if errors: return 3 class UpdatePricesApp( UpdatePricesCommon, UpdatePricesWindow, gui.EscapeHandlingMixin ): def __init__(self, journal, preferences): UpdatePricesCommon.__init__(self, journal, preferences) UpdatePricesWindow.__init__(self) self.fetch_level = 0 self.connect("delete-event", lambda *unused_a: self.save_preferences()) self.activate_escape_handling() self.gatherer_view.set_model(self.gatherer.database) self.close_button.connect( "clicked", lambda _: self.emit('delete-event', None) ) # FIXME: do asynchronously. self.get_ready() def get_ready(self): UpdatePricesCommon.get_ready(self) quotesource_model = Gtk.ListStore(str, object) for q in list(self.quoters.items()): quotesource_model.append(q) self.gatherer_view.quotesource_renderer.set_property( "model", quotesource_model ) self.gatherer_view.quotesource_renderer.set_property( "text-column", 0 ) self.gatherer_view.quotesource_renderer.connect( "editing-started", self.on_quotesource_editing_started ) self.gatherer_view.quotesource_renderer.connect( "edited", self.on_quotesource_editing_done ) self.gatherer_view.quotesource_renderer.connect( "editing-canceled", self.on_quotesource_editing_canceled ) self.gatherer_view.price_in_renderer.connect( "editing-started", self.on_price_in_editing_started ) self.gatherer_view.price_in_renderer.connect( "edited", self.on_price_in_editing_done ) self.gatherer_view.price_in_renderer.connect( "editing-canceled", self.on_price_in_editing_canceled ) self.save_button.connect("clicked", self.save_fetched_prices) self.fetch_button.connect("clicked", lambda _: self.do_fetch()) self.gatherer.connect("gathering-started", self.prevent_fetch) self.gatherer.connect("gathering-started", self.disallow_save) self.gatherer.connect("gathering-started", self.disable_cell_editing) self.gatherer.connect("gathering-done", self.enable_cell_editing) self.gatherer.connect("gathering-done", self.allow_fetch) self.gatherer.connect("gathering-done", self.allow_save) self.gatherer.connect("gathering-done", self.focus_save) self.allow_fetch() self.disallow_save() self.enable_cell_editing() def enable_cell_editing(self, unused_w=None): self.gatherer_view.quotesource_renderer.set_property( "editable", True ) self.gatherer_view.price_in_renderer.set_property( "editable", True ) def disable_cell_editing(self, unused_w=None): self.gatherer_view.quotesource_renderer.set_property( "editable", False ) self.gatherer_view.price_in_renderer.set_property( "editable", False ) def disallow_save(self, unused_w=None): self.save_button.set_sensitive(False) def allow_save(self, unused_w=None): self.save_button.set_sensitive(True) def focus_save(self, unused_w=None): self.save_button.grab_focus() def prevent_fetch(self, unused_w=None): self.fetch_level -= 1 self.fetch_button.set_sensitive(self.fetch_level > 0) def allow_fetch(self, unused_w=None): self.fetch_level += 1 self.fetch_button.set_sensitive(self.fetch_level > 0) def on_quotesource_editing_started(self, *unused_a): self.prevent_fetch() self.suspend_escape_handling() def on_quotesource_editing_done(self, cell, path, new_text, *unused_a, **unused_kw): thedict = dict(x for x in cell.props.model) try: new_quotesource = thedict[new_text] except KeyError: return self.gatherer.database.update_quoter(path, new_quotesource) currency = self.gatherer.database.get_currency_by_path(path) self.preferences["quotesources"][str(currency)] = new_text self.allow_fetch() self.resume_escape_handling() def on_quotesource_editing_canceled(self, *unused_a): self.allow_fetch() self.resume_escape_handling() def on_price_in_editing_started(self, unused_cell, entry, *unused_a): self.prevent_fetch() self.suspend_escape_handling() text = entry.get_text() text = text.split("\n") entry.set_text(", ".join(text)) def on_price_in_editing_done(self, unused_cell, path, new_text, *unused_a, **unused_kw): new_currencies = [ self.journal.commodity(x.strip(), True) for x in new_text.split(",") ] self.gatherer.database.update_price_in(path, new_currencies) currency = self.gatherer.database.get_currency_by_path(path) self.preferences["quotecurrencies"][str(currency)] = [ str(s) for s in new_currencies ] self.allow_fetch() self.resume_escape_handling() def on_price_in_editing_canceled(self, *unused_a): self.allow_fetch() self.resume_escape_handling() def do_fetch(self, *unused_a): self.gatherer.gather_quotes() def save_fetched_prices(self, *unused_a): UpdatePricesCommon.save_fetched_prices(self) self.emit("delete-event", None) def save_preferences(self): self.preferences.persist() def run(self): self.connect("delete-event", Gtk.main_quit) GObject.idle_add(self.show_all) Gtk.main() def main(argv): for datum in "PUBLIC_API_URL OAUTH_API_URL DATATABLES_URL".split(): if getattr(yahoo_finance.yql, datum).startswith("http:"): setattr(yahoo_finance.yql, datum, "https" + yahoo_finance.yql.PUBLIC_API_URL[4:]) p = get_argparser() args = p.parse_args(argv[1:]) ledgerhelpers.enable_debugging(args.debug) GObject.threads_init() journal, settings = gui.load_journal_and_settings_for_gui( price_file_mandatory=True ) klass = UpdatePricesApp if not args.batch else UpdatePricesCommon app = klass(journal, settings) return app.run() ledgerhelpers-0.3.10/src/ledgerhelpers/programs/withdrawcli.py000077500000000000000000000036561434235220400245750ustar00rootroot00000000000000#!/usr/bin/python3 import datetime import ledger import os import sys import ledgerhelpers import ledgerhelpers.legacy as common import ledgerhelpers.legacy_needsledger as common2 import ledgerhelpers.journal as journal def main(): s = ledgerhelpers.Settings.load_or_defaults(os.path.expanduser("~/.ledgerhelpers.ini")) j = journal.Journal.from_file(ledgerhelpers.find_ledger_file(), None) accts, commodities = j.accounts_and_last_commodity_for_account() when = common.prompt_for_date( sys.stdin, sys.stdout, "When?", s.get("last_date", datetime.date.today()) ) if when == datetime.date.today(): del s["last_date"] else: s["last_date"] = when asset1 = common.prompt_for_account( sys.stdin, sys.stdout, accts, "From where?", s.get("last_withdrawal_account", None) ) assert asset1, "Not an account: %s" % asset1 s["last_withdrawal_account"] = asset1 asset1_currency = commodities.get(asset1, ledger.Amount("$ 1")) asset2 = common.prompt_for_account( sys.stdin, sys.stdout, accts, "To where?", s.get("last_deposit_account", None) ) assert asset2, "Not an account: %s" % asset2 s["last_deposit_account"] = asset2 asset2_currency = commodities.get(asset2, ledger.Amount("$ 1")) amount1 = common2.prompt_for_amount( sys.stdin, sys.stdout, "How much?", asset1_currency ) amount2 = common2.prompt_for_amount( sys.stdin, sys.stdout, "What was deposited?", asset2_currency ) lines = j.generate_record("Withdrawal", when, None, "", [ (asset1, -1 * amount1), (asset2, amount2), ]) print("========== Record ==========") print("\n".join(lines)) save = common.yesno( sys.stdin, sys.stderr, "Hit ENTER or y to save it to the file, BACKSPACE or n to skip saving: " ) if save: j.add_text_to_file(lines) ledgerhelpers-0.3.10/src/ledgerhelpers/transactionstatebutton.py000077500000000000000000000043001434235220400252270ustar00rootroot00000000000000#!/usr/bin/python3 # coding: utf-8 import gi; gi.require_version("Gtk", "3.0") from gi.repository import Gtk from ledgerhelpers import parser class TransactionStateButton(Gtk.Button): STATE_CLEARED = parser.STATE_CLEARED STATE_UNCLEARED = parser.STATE_UNCLEARED STATE_PENDING = parser.STATE_PENDING def __init__(self): Gtk.Button.__init__(self) self.label = Gtk.Label() self.add(self.label) self.state = "uninitialized" self.connect("clicked", lambda _: self._rotate_state()) self.get_style_context().add_class("circular") self._rotate_state() def _rotate_state(self): if self.state == self.STATE_UNCLEARED: self.state = self.STATE_CLEARED elif self.state == self.STATE_CLEARED: self.state = self.STATE_PENDING else: self.state = self.STATE_UNCLEARED self._reflect_state() def _reflect_state(self): addtext = "\n\nToggle this to change the transaction state." if self.state == self.STATE_UNCLEARED: self.label.set_markup("∅") self.set_tooltip_text( "This transaction is uncleared." + addtext ) elif self.state == self.STATE_CLEARED: self.label.set_markup("✻") self.set_tooltip_text( "This transaction is cleared." + addtext ) else: self.label.set_markup("!") self.set_tooltip_text( "This transaction is pending." + addtext ) def get_state(self): return self.state def get_state_char(self): if self.state == parser.STATE_CLEARED: clearing_state = parser.CHAR_CLEARED elif self.state == parser.STATE_UNCLEARED: clearing_state = "" elif self.state == parser.STATE_PENDING: clearing_state = parser.CHAR_PENDING else: assert 0, "not reached" return clearing_state def set_state(self, state): assert state in (self.STATE_CLEARED, self.STATE_PENDING, self.STATE_UNCLEARED) self.state = state self._reflect_state() ledgerhelpers-0.3.10/tests/000077500000000000000000000000001434235220400155615ustar00rootroot00000000000000ledgerhelpers-0.3.10/tests/__init__.py000066400000000000000000000000001434235220400176600ustar00rootroot00000000000000ledgerhelpers-0.3.10/tests/dogtail/000077500000000000000000000000001434235220400172045ustar00rootroot00000000000000ledgerhelpers-0.3.10/tests/dogtail/addtrans.py000066400000000000000000000034321434235220400213600ustar00rootroot00000000000000#!/usr/bin/python3 # Dogtail test script for addtrans. import os import pipes import tempfile from dogtail import config from dogtail import tree from dogtail.procedural import type from dogtail.rawinput import keyCombo, pressKey from dogtail.utils import run os.environ['LANG'] = "en_US.UTF-8" os.environ['PYTHONPATH'] = os.path.join( os.path.dirname(__file__), os.path.pardir, os.path.pardir, 'src' ) os.environ['PATH'] = os.path.join( os.path.dirname(__file__), os.path.pardir, os.path.pardir, 'bin' ) + os.path.pathsep + os.environ['PATH'] config.config.typingDelay = 0.025 t = tempfile.NamedTemporaryFile() t.write(""" 2015-10-05 * beer Assets:Cash -30 CHF Expenses:Drinking 30 CHF """) t.flush() t.seek(0, 0) run('addtrans --file %s' % pipes.quote(t.name)) addtrans = tree.root.application('addtrans') mainwin = addtrans.window('Add transaction') try: type("wine") pressKey("Tab") type("30") pressKey("Tab") type("Expenses:Drinking") pressKey("Tab") pressKey("Tab") type("Assets:Cash") pressKey("Tab") expected = """ 2016-11-09 wine Expenses:Drinking 30 CHF Assets:Cash """ actual = mainwin.child(name='Transaction preview').children[0].text assert ( actual == expected ), ( "Transaction preview did not contain 30 CHF as expected.\n" "Expected: %r\n" "Actual: %r" % (expected, actual) ) finally: keyCombo("c") #def recurse(child, level=0): #try: #print " " * level, child.getAbsoluteSearchPath() #print " " * level, child.text #except UnicodeDecodeError: #print " " * level, "[undecodable path]" #for c in child.children: #recurse(c, level+1) #recurse(mainwin) ledgerhelpers-0.3.10/tests/test_base.py000066400000000000000000000005131434235220400201030ustar00rootroot00000000000000import codecs import os import ledgerhelpers as m if os.getenv('LEDGERHELPERS_TEST_DEBUG'): m.enable_debugging(True) def datapath(filename): return os.path.join(os.path.dirname(__file__), "testdata", filename) def data(filename): with codecs.open(datapath(filename), "rb", "utf-8") as f: return f.read() ledgerhelpers-0.3.10/tests/test_ledgerhelpers.py000066400000000000000000000067271434235220400220330ustar00rootroot00000000000000import datetime import ledgerhelpers as m import ledgerhelpers.legacy as mc try: import ledgerhelpers.journal as journal except ImportError: journal = None import tests.test_base as base import tempfile import unittest from unittest import TestCase as T @unittest.skipIf(journal is None, reason="ledger-python is not available on this system") class TestJournal(T): def test_journal_with_simple_transaction(self): c = base.datapath("simple_transaction.dat") j = journal.Journal.from_file(c, None) payees = j.all_payees() self.assertListEqual(payees, ["beer"]) accts, commos = j.accounts_and_last_commodity_for_account() expaccts = ["Accounts:Cash", "Expenses:Drinking"] self.assertListEqual(accts, expaccts) self.assertEqual(commos["Expenses:Drinking"], "1.00 CHF") def test_reload_works(self): with tempfile.NamedTemporaryFile(mode="w") as f: with open(base.datapath("simple_transaction.dat")) as transaction_data: data = transaction_data.read() f.write(data) f.flush() j = journal.Journal.from_file(f.name, None) _, commos = j.accounts_and_last_commodity_for_account() self.assertEqual(commos["Expenses:Drinking"], "1.00 CHF") data = data.replace("CHF", "EUR") f.write(data) f.flush() _, commos = j.accounts_and_last_commodity_for_account() self.assertEqual(commos["Expenses:Drinking"], "1.00 EUR") def test_transactions_with_payee_match(self): c = base.datapath("simple_transaction.dat") j = journal.Journal.from_file(c, None) ts = journal.transactions_with_payee("beer", j.internal_parsing()) self.assertEqual(ts[0].payee, "beer") def test_transaction_with_zero_posting(self): c = base.datapath("zero.dat") j = journal.Journal.from_file(c, None) _, commos = j.accounts_and_last_commodity_for_account() self.assertEqual(commos["rest"], "1 USD") class TestGenerateRecord(T): def test_no_spurious_whitespace(self): title = "x" date = datetime.date(2014, 1, 1) cleared_date = None accountamounts = [ ("assets", "56 CHF"), ("expenses", ""), ] res = mc.generate_record(title, date, cleared_date, "", accountamounts) self.assertListEqual( res, """ 2014-01-01 x assets 56 CHF expenses """.splitlines()) def test_no_cleared_date_when_cleared_date_not_supplied(self): cases = [ ("2014-01-01 x", (datetime.date(2014, 1, 1), None), ""), ("2014-01-01 * x", (datetime.date(2014, 1, 1), datetime.date(2014, 1, 1)), "*"), ("2014-01-01=2015-01-01 ! x", (datetime.date(2014, 1, 1), datetime.date(2015, 1, 1)), "!"), ] accountamounts = [("assets", "56 CHF"), ("expenses", "")] for expected_line, (date, cleared), statechar in cases: res = mc.generate_record("x", date, cleared, statechar, accountamounts)[1] self.assertEqual(res, expected_line) def test_empty_record_auto_goes_last(self): accountamounts = [("expenses", ""), ("assets:cash", "56 CHF")] res = mc.generate_record("x", datetime.date(2014, 1, 1), None, "", accountamounts) self.assertListEqual( res, """ 2014-01-01 x assets:cash 56 CHF expenses """.splitlines()) ledgerhelpers-0.3.10/tests/test_parser.py000066400000000000000000000057451434235220400205010ustar00rootroot00000000000000import datetime import ledgerhelpers.parser as parser import tests.test_base as base from unittest import TestCase as T class TestParser(T): def test_simple_transaction(self): c = base.data("simple_transaction.dat") items = parser.lex_ledger_file_contents(c) self.assertEqual(len(items), 3) for n, tclass in enumerate([ parser.TokenWhitespace, parser.TokenTransaction, parser.TokenWhitespace, ]): self.assertIsInstance(items[n], tclass) transaction = items[1] self.assertEqual(transaction.date, datetime.date(2015, 3, 12)) self.assertEqual(transaction.clearing_date, datetime.date(2015, 3, 15)) self.assertEqual(transaction.payee, "beer") for n, (ac, am) in enumerate([ ("Accounts:Cash", "-6.00 CHF"), ("Expenses:Drinking", "6.00 CHF"), ]): self.assertEqual(transaction.postings[n].account, ac) self.assertEqual(transaction.postings[n].amount, am) def test_no_end_value(self): c = base.data("no_end_value.dat") items = parser.lex_ledger_file_contents(c) self.assertEqual(len(items), 5) for n, tclass in enumerate([ parser.TokenWhitespace, parser.TokenTransaction, parser.TokenWhitespace, parser.TokenTransaction, parser.TokenWhitespace, ]): self.assertIsInstance(items[n], tclass) for transaction in (items[1], items[3]): self.assertEqual(transaction.payee, "beer") for n, (ac, am) in enumerate([ ("Accounts:Cash", "-6.00 CHF"), ("Expenses:Drinking", ""), ]): self.assertEqual(transaction.postings[n].account, ac) self.assertEqual(transaction.postings[n].amount, am) def test_with_comments(self): c = base.data("with_comments.dat") items = parser.lex_ledger_file_contents(c) self.assertEqual(len(items), 3) for n, tclass in enumerate([ parser.TokenWhitespace, parser.TokenTransaction, parser.TokenWhitespace, ]): self.assertIsInstance(items[n], tclass) transaction = items[1] self.assertEqual(transaction.date, datetime.date(2011, 12, 25)) self.assertEqual(transaction.clearing_date, datetime.date(2011, 12, 25)) self.assertEqual(transaction.payee, "a gift!") self.assertEqual(transaction.state, parser.STATE_CLEARED) for n, (ac, am) in enumerate([ ("Assets:Metals", "1 \"silver coin\" @ $55"), ("Income:Gifts", "$ -55"), ]): self.assertEqual(transaction.postings[n].account, ac) self.assertEqual(transaction.postings[n].amount, am) def test_my_data_file(self): try: c = base.data("/home/user/.ledger") except IOError: return items = parser.lex_ledger_file_contents(c) ledgerhelpers-0.3.10/tests/testdata/000077500000000000000000000000001434235220400173725ustar00rootroot00000000000000ledgerhelpers-0.3.10/tests/testdata/no_end_value.dat000066400000000000000000000002631434235220400225230ustar00rootroot00000000000000 2015-03-12=2015-03-15 * beer Accounts:Cash -6.00 CHF Expenses:Drinking 2015-03-12=2015-03-15 * beer Accounts:Cash -6.00 CHF Expenses:Drinking ledgerhelpers-0.3.10/tests/testdata/simple_transaction.dat000066400000000000000000000001451434235220400237620ustar00rootroot00000000000000 2015-03-12=2015-03-15 * beer Accounts:Cash -6.00 CHF Expenses:Drinking 6.00 CHF ledgerhelpers-0.3.10/tests/testdata/with_comments.dat000066400000000000000000000003221434235220400227410ustar00rootroot000000000000002011/12/25 * a gift! ; the price for the following purchase was assumed Assets:Metals 1 "silver coin" @ $55 Income:Gifts $ -55 ledgerhelpers-0.3.10/tests/testdata/zero.dat000066400000000000000000000000571434235220400210450ustar00rootroot000000000000002022-01-01 zero ac1 1 USD ac2 -1 USD rest ledgerhelpers-0.3.10/tox.ini000066400000000000000000000003611434235220400157320ustar00rootroot00000000000000[tox] envlist = basepython [testenv] setenv = PYTHONPATH = {toxinidir}/src # Unnecessary in a --current-env scenario. # These are already installed in the test container. # deps = # pytest # ledger commands = pytest-3 {posargs}