From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED.Oh2LSLzxQ4+YU0Htrufc+A.user.gioia.aioe.org!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Got to ask this about GPS: Do others have the same problems with Python? Date: Wed, 04 Mar 2020 15:04:25 +0000 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: Oh2LSLzxQ4+YU0Htrufc+A.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (darwin) Cancel-Lock: sha1:NTY1tnG1UXWfYrnQErwuLWyQTJM= X-Notice: Filtered by postfilter v. 0.9.2 Xref: reader01.eternal-september.org comp.lang.ada:58169 Date: 2020-03-04T15:04:25+00:00 List-Id: Rick Newbie writes: > For instance: I create a procedure header in an ADS file then use the > "Generate Body Of ..." from the context menu and I get this in the > output window: Not just Windows! On macOS, the first time I tried it (on a spec that shouldn't have had a body) I got gnat stub -P/Users/simon/tmp/so/rules.gpr /Users/simon/tmp/so/rules.ads /Users/simon/tmp/so/ but no .adb. The second time, I got the same output as you describe (modulo Windows vs Unix). The third time, after I added a subprogram (so a body was valid), it worked. The fourth time, after I removed the subprogram, back we are with your error! Traceback (most recent call last): File "/opt/gnat-ce-2019/share/gps/support/core/gps_utils/__init__.py", line 352, in do r = callback() File "/opt/gnat-ce-2019/share/gps/support/core/gnatstub.py", line 173, in generate_plain_body generate_body(as_separate=False) File "/opt/gnat-ce-2019/share/gps/support/core/gnatstub.py", line 153, in generate_body command += x_args + [file.path, file.directory()] AttributeError: 'NoneType' object has no attribute 'path' If I run the command that GPS says it's executing by hand, I get $ gnat stub -P/Users/simon/tmp/so/rules.gpr /Users/simon/tmp/so/rules.ads /Users/simon/tmp/so/ gnatstub: tree file rules.adt already exists use -r or -t to reuse or to overwrite it so I use -t and get $ gnat stub -t -P/Users/simon/tmp/so/rules.gpr /Users/simon/tmp/so/rules.ads /Users/simon/tmp/so/ gnatstub: Compilation unit Rules does not require a body (and rules.adt has been deleted, so I don't need to use -t next time).