-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Tom,
Thanks again for the quick reply. After some more trying, I found that the following works (with Gnucash 2.4): guid = GncGUID() string_to_guid("a3817efd668585e2f4431e2996683fd1", guid) Best, Jonas - -------- Original Message -------- Subject: Re: Creating GUID From: Tom Lofts <d...@loftx.co.uk> To: 'Jonas Lippuner' <jo...@lippuner.ca> Cc: gnucash-devel@gnucash.org Date: Wed 05 Jun 2013 01:22:31 AM PDT > Hi Jonas, > > This is another recent addition, so again you'll need at least > Gnucash 2.5.1. This introduces a GUIDString class which will > convert a GUID to a string as follows: > > guid_sting = 'a3817efd668585e2f4431e2996683fd1' account_guid = > gnucash.gnucash_core.GUID() > gnucash.gnucash_core.GUIDString(guid_string, account_guid) > > You can see an example of this code in the getAccount method at > https://github.com/Gnucash/gnucash/blob/trunk/src/optional/python-bindings/example_scripts/rest-api/gnucash_rest.py > > As an aside, I'm not entirely happy about the GUIDString class, as > this should really be implemented as a method of the GUID class > rather than it's own class. Any suggestions from an experinced > Pythoner would be much appreciated - the relevent class is defined > in > https://github.com/Gnucash/gnucash/blob/trunk/src/optional/python-bindings/gnucash_core.py > > > Kind regards, > > Tom > > -----Original Message----- From: > gnucash-devel-bounces+dev=loftx.co...@gnucash.org > [mailto:gnucash-devel-bounces+dev=loftx.co...@gnucash.org] On > Behalf Of Jonas Lippuner Sent: 05 June 2013 08:42 To: > gnucash-devel@gnucash.org Subject: Creating GUID > > Hi guys, > > If I know the string of a GUID, how do I create the corresponding > GUID object in the Python bindings for Gnucash? > > The only thing I got to run is > > guid = GUID() string_to_guid("a3817efd668585e2f4431e2996683fd1", > guid.__weakref__) > > But this does not work since the variable guid gets a value when it > is created and string_to_guid does not change that value, i.e. I > just get a new guid with a random value... > > > Also, I noticed that it is possible to create multiple customers > with the same Customer ID. Is this intentional? > > > Thanks for the help, Jonas > > _______________________________________________ gnucash-devel > mailing list gnucash-devel@gnucash.org > https://lists.gnucash.org/mailman/listinfo/gnucash-devel > - -- My email is signed and I encrypt email on request. To verify my signature or send me encrypted email, get my public key: http://lippuner.ca/key -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJRrvXjAAoJELH92qHy0gntuUEP/imZRxtOdxdoIO0bpvtbvwnw ctxHnZRjW7f9rYq3UPM1NT1tD8CZXCHqm7g7nAZTpNnuxE5LZ03rS4yUjQtfg7Sy yOYR76ClLkUVXNTXznynDZp50T2NqrXH5xvqTpeT2UiqwvMGNNh8vZizUEST5YHv rtI2M73sU/lvHuuza3AJjYiBjFbZS9SxgeR6O50uGIBjt8Qud7MxNgP4hRVnkYto SP0xnrHPpDqfzxMwLKX8ru2PopEaCoUVNZHPaurhK8bDh+sNrHqPDigxd5L72HlP PuSjAai/ybM/+i6IH5MGrprlcfuCWbXdmMCKM7zsDjYH9QShcIZivK0MY6lFQanp 0uTBFJ76WVmKoyTlFYaK0NifqP7ubS96E85N9/ffw3jLNvved8TqLILAq5xu+0dN ZTwtf7TY19IafLzMrdAt3hbj7AKbAaHzdosaaxZGCpEXyvsyVOK9TrA/yJMt7fRv TgVRJVncnUWFnmsmbA+ek5IfUrrjpJAGMEFX9jX23jneulZGAVJFJLwmyxbKFZNU Usj2CG7Zf9QZ7AYij2iGbEj56xvgywE9DsumoThqsMEizQMynGH4qIZePsl4Wc4W k9tEI1ZGrctzENSqmhb5dqnZZ8OnvB+VaI+aNBljY5vyut/cp9ZM8RxOqO+/Hpim 71vCDlcVySwEBsFvzB1B =zOGq -----END PGP SIGNATURE----- _______________________________________________ gnucash-devel mailing list gnucash-devel@gnucash.org https://lists.gnucash.org/mailman/listinfo/gnucash-devel