Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verbose output: KeyError (interface needs to be added) #39

Open
ghost opened this issue Aug 2, 2018 · 6 comments
Open

Verbose output: KeyError (interface needs to be added) #39

ghost opened this issue Aug 2, 2018 · 6 comments
Labels

Comments

@ghost
Copy link

ghost commented Aug 2, 2018

When having the verbose output enabled I ran into an issue in https://github.com/svenevs/exhale/blob/master/exhale/graph.py#L458. self.kind was interface but this wasn't present in fmt_spec so fmt_spec[self.kind] was giving a KeyError. Better check for that since it's "only" a debug message.

@svenevs svenevs changed the title Verbose output: KeyError Verbose output: KeyError (interface needs to be added) Aug 2, 2018
@svenevs
Copy link
Owner

svenevs commented Aug 2, 2018

Ahhhh yes interface, the forgotten child. To be honest I never expected Exhale to be able to support anything but C++, but apparently you've had some potential success with PHP as well as another user with Verilog.

Adding support for .. doxygeninterface:: shouldn't be super difficult, I just need to treat it like "class" and "struct". I was avoiding some pesky issues with Exhale because I thought I would be able to finish a more hefty rewrite of something but I'm fixing the pesky issues first now, so I'll throw this one in there. I'll want to fix #28 first though.

I know zero PHP, do you have some brief sample code that demonstrates an interface? If not I'll add some ugly Java code for the interface test case (ugly because it's been at least 6 years since I've done any Java...).

@svenevs svenevs added the bug label Aug 2, 2018
@ghost
Copy link
Author

ghost commented Aug 6, 2018

This is an example of an interface class in PHP:

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to [email protected] so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    Mage
 * @package     Mage_Api
 * @copyright  Copyright (c) 2006-2017 X.commerce, Inc. and affiliates (http://www.magento.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */

/**
 * Web service api server interface
 *
 * @category   Mage
 * @package    Mage_Api
 * @author     Magento Core Team <[email protected]>
 */
interface Mage_Api_Model_Server_Adapter_Interface
{
    /**
     * Set handler class name for webservice
     *
     * @param string $handler
     * @return Mage_Api_Model_Server_Adapter_Interface
     */
    function setHandler($handler);

    /**
     * Retrive handler class name for webservice
     *
     * @return string
     */
    function getHandler();

    /**
     * Set webservice api controller
     *
     * @param Mage_Api_Controller_Action $controller
     * @return Mage_Api_Model_Server_Adapter_Interface
     */
    function setController(Mage_Api_Controller_Action $controller);

    /**
     * Retrive webservice api controller
     *
     * @return Mage_Api_Controller_Action
     */
    function getController();

    /**
     * Run webservice
     *
     * @return Mage_Api_Model_Server_Adapter_Interface
     */
    function run();

    /**
     * Dispatch webservice fault
     *
     * @param int $code
     * @param string $message
     */
    function fault($code, $message);

} // Class Mage_Api_Model_Server_Adapter_Interface End

@svenevs
Copy link
Owner

svenevs commented Aug 26, 2018

Hey @glamic-ep sorry for forgetting about this. Thank you for the example PHP snippet!

If I recall correctly, you are no longer planning on using Exhale, you intend to customize the Doxygen HTML? I was able to get some minimal Fortran support, but for PHP I'd need to actually be a lot more careful about certain things after looking more closely at the language.

If you aren't planning on using Exhale, I will solve this at a much later date. If you are, then I can add some temporary hacks in just to make it work.

@ghost
Copy link
Author

ghost commented Sep 10, 2018

Yes, correct, I have now gone down the Doxygen route. That means there is no immediate need for me to have customized/updated anything. Thanks for your help.

@lexxxel
Copy link

lexxxel commented Nov 7, 2019

I fall into the same bug and created MR #84

@IceflowRE
Copy link
Contributor

IceflowRE commented Mar 27, 2021

/// @example auto render_pass_ci = make_info<VkRenderPassCreateInfo>();

Results into

(!) Exhale: could not generate reStructuredText documents :/Traceback (most recent call last):
  File "c:\python39\lib\site-packages\exhale\__init__.py", line 25, in environment_ready
    deploy.explode()
  File "c:\python39\lib\site-packages\exhale\deploy.py", line 423, in explode
    textRoot.toConsole()
  File "c:\python39\lib\site-packages\exhale\graph.py", line 3823, in toConsole
    self.consoleFormat(
  File "c:\python39\lib\site-packages\exhale\graph.py", line 3880, in consoleFormat
    l.toConsole(0, fmt_spec)
  File "c:\python39\lib\site-packages\exhale\graph.py", line 543, in toConsole
    c.toConsole(level + 1, fmt_spec)
  File "c:\python39\lib\site-packages\exhale\graph.py", line 516, in toConsole
    kind=utils._use_color(self.kind, fmt_spec[self.kind], sys.stderr),
KeyError: 'example'

Not 100% sure if thats the same issue.
Ignore that its a wrong doxygen usage too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants