Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2016-08

googleapiconv

16 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dave Connolly

Hi all,

When I run googleapiconv, I get the following

./googleapiconv -s calendar/v3 -o calendar.pp
Exception at 0000000000494F7F: ERESTAPI:
Unknown class : "(]t�]t�]tX^tp^t".

and

./googleapiconv -s tasks/v1 -o tasks.pp
Exception at 0000000000494F7F: ERESTAPI:
Unknown class : "(]t�]t�]tX^tp^t".

Has something changed?

FPC 3.1.1 on Linux x86_64

Many thanks,
Dave

Michael Van Canneyt
to Dave Connolly
Dave Connolly wrote 15 lines
Hi all, When I run googleapiconv, I get the following ./googleapiconv -s calendar/v3 -o calendar.pp Exception at 0000000000494F7F: ERESTAPI: Unknown class : "(]t???]t???]tX^tp^t". and ./googleapiconv -s tasks/v1 -o tasks.pp Exception at 0000000000494F7F: ERESTAPI: Unknown class : "(]t???]t???]tX^tp^t". Has something changed?

Not to my knowledge, I even recently converted all services again ?

Can you run with -k and send the downloaded .json file ?

Michael.

Dave Connolly
to Michael Van Canneyt

./googleapiconv -k -s calendar/v3 -o calendar.pp

Michael Van Canneyt wrote 30 lines
On Fri, 12 Aug 2016, Dave Connolly wrote: Hi all, > > When I run googleapiconv, I get the following > > ./googleapiconv -s calendar/v3 -o calendar.pp > Exception at 0000000000494F7F: ERESTAPI: > Unknown class : "(]t???]t???]tX^tp^t". > > and > > ./googleapiconv -s tasks/v1 -o tasks.pp > Exception at 0000000000494F7F: ERESTAPI: > Unknown class : "(]t???]t???]tX^tp^t". > > Has something changed? > Not to my knowledge, I even recently converted all services again ? Can you run with -k and send the downloaded .json file ? Michael. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Lubos Pintes
to Michael Van Canneyt: Not to my knowledge, I even recently converted all services again ? Can you run with -k…

Hello,
It seems to me that all this is broken in some way. Well it may be my stupidity because I am receiving an Unhandled exception. I don't know how to generate useful trace, I am developing on Windows from command line.
The lines I was able to see was GoogleService.pp, line 350 and GoogleCalendar.pp, line 4265.
I am trying to write a console app for testing. After I authorize my app and write the code Google provides, it is trying to call the TCalendarResource.List with no parameters.

Dňa 12. 8. 2016 o 13:18 Michael Van Canneyt napísal(a):

Show quoted text 30 lines
On Fri, 12 Aug 2016, Dave Connolly wrote: > Hi all, > > When I run googleapiconv, I get the following > > ./googleapiconv -s calendar/v3 -o calendar.pp > Exception at 0000000000494F7F: ERESTAPI: > Unknown class : "(]t???]t???]tX^tp^t". > > and > > ./googleapiconv -s tasks/v1 -o tasks.pp > Exception at 0000000000494F7F: ERESTAPI: > Unknown class : "(]t???]t???]tX^tp^t". > > Has something changed? Not to my knowledge, I even recently converted all services again ? Can you run with -k and send the downloaded .json file ? Michael. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Michael Van Canneyt
to Lubos Pintes
Lubos Pintes wrote 10 lines
Hello, It seems to me that all this is broken in some way. Well it may be my stupidity because I am receiving an Unhandled exception. I don't know how to generate useful trace, I am developing on Windows from command line. The lines I was able to see was GoogleService.pp, line 350 and GoogleCalendar.pp, line 4265. I am trying to write a console app for testing. After I authorize my app and write the code Google provides, it is trying to call the TCalendarResource.List with no parameters.

I'm a bit surprised at the difficulties you are experiencing, the GUI sample programs with Lazarus worked fine when I wrote them. More recently I wrote a google drive console demo app, it also works fine. The drive code is in actual production use. Idem for the calendar, I use it to hourly synchronize our company's calendar database with Google calendar; It works since a long time...

I will look into writing a console app for testing the calendar.

Michael.

Marco van de Voort
to Michael Van Canneyt

In our previous episode, Michael Van Canneyt said:

Show quoted text 11 lines
On Fri, 12 Aug 2016, Dave Connolly wrote: > ./googleapiconv -k -s calendar/v3 -o calendar.pp > I tested the converter on the JSON output, and it works fine, it compiles: ./googleapiconv -i /home/michael/calendar.json fpc /home/michael/calendar.pp I'm completely baffled. Can you try with the trunk version of FPC ?

Typical for text processing that sometimes works and sometimes not: locale issues? Specially calendar sounds like something that might use date-time functions.

Michael Van Canneyt
to Marco van de Voort
Marco van de Voort wrote 16 lines
In our previous episode, Michael Van Canneyt said: > On Fri, 12 Aug 2016, Dave Connolly wrote: > >> ./googleapiconv -k -s calendar/v3 -o calendar.pp >> > > I tested the converter on the JSON output, and it works fine, it compiles: > > ./googleapiconv -i /home/michael/calendar.json > fpc /home/michael/calendar.pp > > I'm completely baffled. Can you try with the trunk version of FPC ? Typical for text processing that sometimes works and sometimes not: locale issues? Specially calendar sounds like something that might use date-time functions.

I would be surprised, Date/Time is handled explicitly by ISO 8601/RFC 3339.

Michael.

Lubos Pintes
to Michael Van Canneyt: I'm a bit surprised at the difficulties you are experiencing, the GUI sample programs…

Well it didn't seem relevant. I am a screen reader user and Lazarus is inaccessible, so I don't use it, it is currently unusable. I tryed to compile some demos but I was unable to drive the IDe, even button captions are not read for me. And there were some packages missing, maybe only on Windows.
I compiled one Lazarus from trunk, not sure which version exactly but I suppose it was something like 1.7.
Dňa 13. 8. 2016 o 11:56 Michael Van Canneyt napísal(a):

Show quoted text 32 lines
On Sat, 13 Aug 2016, Lubos Pintes wrote: > Hello, > It seems to me that all this is broken in some way. > Well it may be my stupidity because I am receiving an Unhandled > exception. > I don't know how to generate useful trace, I am developing on Windows > from command line. > The lines I was able to see was GoogleService.pp, line 350 and > GoogleCalendar.pp, line 4265. > I am trying to write a console app for testing. After I authorize my > app and write the code Google provides, it is trying to call the > TCalendarResource.List with no parameters. I'm a bit surprised at the difficulties you are experiencing, the GUI sample programs with Lazarus worked fine when I wrote them. More recently I wrote a google drive console demo app, it also works fine. The drive code is in actual production use. Idem for the calendar, I use it to hourly synchronize our company's calendar database with Google calendar; It works since a long time... I will look into writing a console app for testing the calendar. Michael. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Dave Connolly
to Michael Van Canneyt: I tested the converter on the JSON output, and it works fine, it compiles:…

Hi Michael,

I've tried ./googleapiconv -i ./calander.json on both 32-bit and 64-bit Linux and I get the same error on both platforms.

32-bit
./googleapiconv -i ./calendar.json
Exception at 080BA538: ERESTAPI:
Unknown class : " �(
�<�l�����,�x�����(�l�����������0�D�P�h���������0�D�p������� �0�D�X�l��� ".

64-bit
./googleapiconv -i ./calendar.json
Exception at 0000000000492B3F: ERESTAPI:
Unknown class : "sp�s��s��s��s �sX�s��s �s��s���s0�sh�s��s �sP�s��s�s �sp�s��s��s0tXt

FPC 3.1.1 (rev 34315).

Dave

Michael Van Canneyt wrote 20 lines
On Fri, 12 Aug 2016, Dave Connolly wrote: ./googleapiconv -k -s calendar/v3 -o calendar.pp > > I tested the converter on the JSON output, and it works fine, it compiles: ./googleapiconv -i /home/michael/calendar.json fpc /home/michael/calendar.pp I'm completely baffled. Can you try with the trunk version of FPC ? Michael. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Dave Connolly
to Dave Connolly

The Google APIs run fine when compiled with FPC 3.0.0

Dave Connolly wrote 50 lines
Hi Michael, I've tried ./googleapiconv -i ./calander.json on both 32-bit and 64-bit Linux and I get the same error on both platforms. 32-bit ./googleapiconv -i ./calendar.json Exception at 080BA538: ERESTAPI: Unknown class : " �( �<�l�����,�x�����(�l�����������0�D�P�h���������0�D�p������� �0�D�X�l��� ". 64-bit ./googleapiconv -i ./calendar.json Exception at 0000000000492B3F: ERESTAPI: Unknown class : "sp�s��s��s��s �sX�s��s �s��s���s0�sh�s��s �sP�s��s�s �sp�s��s��s0tXt FPC 3.1.1 (rev 34315). Dave On 13 August 2016 at 13:10, Michael Van Canneyt wrote: > > > On Fri, 12 Aug 2016, Dave Connolly wrote: > > ./googleapiconv -k -s calendar/v3 -o calendar.pp >> >> > I tested the converter on the JSON output, and it works fine, it compiles: > > ./googleapiconv -i /home/michael/calendar.json > fpc /home/michael/calendar.pp > > I'm completely baffled. Can you try with the trunk version of FPC ? > > > Michael. > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal >
Dave Connolly
to Michael Van Canneyt
From what I can see the error seems to involve these two lines in the
procedure TBaseObject.SetObjectProperty(P: PPropInfo; AValue: TJSONObject);
in restbase.pp (fcl-web)
    PA:=@(pdynarraytypeinfo(P^.PropType)^.elesize)+i;
    PA:=@(pdynarraytypeinfo(P^.PropType)^.eletype)+i;
    AN:=PTYpeInfo(PA^)^.Name;

In my scenario the PTYpeInfo(PA^)^.Name is ""

FPC 3.1.1 revision 34368

Regards,
Dave

Michael Van Canneyt wrote 15 lines
On Mon, 15 Aug 2016, Dave Connolly wrote: The Google APIs run fine when compiled with FPC 3.0.0 > Strange. I will look into it. Michael. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Michael Van Canneyt
to Dave Connolly
Dave Connolly wrote 13 lines
> From what I can see the error seems to involve these two lines in the procedure TBaseObject.SetObjectProperty(P: PPropInfo; AValue: TJSONObject); in restbase.pp (fcl-web) PA:=@(pdynarraytypeinfo(P^.PropType)^.elesize)+i; PA:=@(pdynarraytypeinfo(P^.PropType)^.eletype)+i; AN:=PTYpeInfo(PA^)^.Name; In my scenario the PTYpeInfo(PA^)^.Name is "" FPC 3.1.1 revision 34368

I suspect this has to do with the additional level of indirection added by Sven Barth. I will need to check that.

Michael.

Sven Barth
"Michael Van Canneyt" wrote 8 lines
On Mon, 22 Aug 2016, Dave Connolly wrote: >> From what I can see the error seems to involve these two lines in the > > procedure TBaseObject.SetObjectProperty(P: PPropInfo; AValue:
TJSONObject);
Show quoted text 15 lines
> in restbase.pp (fcl-web) > > PA:=@(pdynarraytypeinfo(P^.PropType)^.elesize)+i; > PA:=@(pdynarraytypeinfo(P^.PropType)^.eletype)+i; > > > AN:=PTYpeInfo(PA^)^.Name; > > In my scenario the PTYpeInfo(PA^)^.Name is "" > > FPC 3.1.1 revision 34368 I suspect this has to do with the additional level of indirection added by Sven Barth. I will need to check that.

Best don't use pdynarraytypeinfo as that doesn't correctly handle alignment either, use PTypeData instead.

Regards,
Sven

Michael Van Canneyt
to Sven Barth
Sven Barth wrote 28 lines
Am 22.08.2016 15:16 schrieb "Michael Van Canneyt" : > > > > On Mon, 22 Aug 2016, Dave Connolly wrote: > >>> From what I can see the error seems to involve these two lines in the >> >> procedure TBaseObject.SetObjectProperty(P: PPropInfo; AValue: TJSONObject); >> in restbase.pp (fcl-web) >> >> PA:=@(pdynarraytypeinfo(P^.PropType)^.elesize)+i; >> PA:=@(pdynarraytypeinfo(P^.PropType)^.eletype)+i; >> >> >> AN:=PTYpeInfo(PA^)^.Name; >> >> In my scenario the PTYpeInfo(PA^)^.Name is "" >> >> FPC 3.1.1 revision 34368 > > > I suspect this has to do with the additional level of indirection added by > Sven Barth. I will need to check that. Best don't use pdynarraytypeinfo as that doesn't correctly handle alignment either, use PTypeData instead.

So what should this be changed to:

     i:=Length(P^.PropType^.name);
     PA:=@(pdynarraytypeinfo(P^.PropType)^.eletype)+i;
     ET:=PTYpeInfo(PA^);
     if (ET^.Kind=tkClass) then
       begin
       // get object type name
       AN:=ET^.Name;
       // Free all objects
       O:=TObjectArray(AP);
       For I:=0 to Length(O)-1 do
         FreeAndNil(O[i]);
       end;
     // Clear array
{$ifdef ver2_6}
     LPN:=Lowercase(P^.Name);
     SetArrayLength(LPN,0);
{$else}
     I:=0;
     DynArraySetLength(AP,P^.PropType,1,@i);
{$endif}
     // Now, set new length

Michael.