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

consider no namespace for relationship #31

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

cheoljoo
Copy link
Contributor

  • if this class is not in namespace , we need to change the relationship expression
    • original) .RegionExtBase *-- .EnvironmentVariant
    • expected) RegionExtBase *-- EnvironmentVariant
  • if we remove start period(.) when this class is not in namespace , we can see the right plantuml.

# Additional function : --version
- add --version arguments in command line
- I think that modified version will be 0.3

# Bug : What is the problem
- we have the error when we use enum without name.
```
enum {
    AAAAAAA,
    BBBBBBB,
};
```

- Error Message
```
[1133] WARN-enum: nameless enum ['enum', '{', 'AAAAAAA', ',', 'BBBBBBB', ',', '}']
Traceback (most recent call last):
  File "/Users/cheoljoo/.local/bin/hpp2plantuml", line 11, in <module>
    load_entry_point('hpp2plantuml==0.2', 'console_scripts', 'hpp2plantuml')()
  File "/Users/cheoljoo/.local/lib/python3.6/site-packages/hpp2plantuml-0.2-py3.6.egg/hpp2plantuml/hpp2plantuml.py", line 1110, in main
    CreatePlantUMLFile(args.input_files, args.output_file)
  File "/Users/cheoljoo/.local/lib/python3.6/site-packages/hpp2plantuml-0.2-py3.6.egg/hpp2plantuml/hpp2plantuml.py", line 1080, in CreatePlantUMLFile
    diag.create_from_file_list(list(set(expand_file_list(file_list_c))))
  File "/Users/cheoljoo/.local/lib/python3.6/site-packages/hpp2plantuml-0.2-py3.6.egg/hpp2plantuml/hpp2plantuml.py", line 768, in create_from_file_list
    flag_build_lists=True, flag_reset=True)
  File "/Users/cheoljoo/.local/lib/python3.6/site-packages/hpp2plantuml-0.2-py3.6.egg/hpp2plantuml/hpp2plantuml.py", line 747, in _build_helper
    self.parse_objects(single_input, build_from_single)
  File "/Users/cheoljoo/.local/lib/python3.6/site-packages/hpp2plantuml-0.2-py3.6.egg/hpp2plantuml/hpp2plantuml.py", line 860, in parse_objects
    self._objects.append(container_handler(obj))
  File "/Users/cheoljoo/.local/lib/python3.6/site-packages/hpp2plantuml-0.2-py3.6.egg/hpp2plantuml/hpp2plantuml.py", line 32, in <lambda>
    ['enums', lambda objs: objs, lambda obj: Enum(obj)]
  File "/Users/cheoljoo/.local/lib/python3.6/site-packages/hpp2plantuml-0.2-py3.6.egg/hpp2plantuml/hpp2plantuml.py", line 486, in __init__
    super().__init__('enum', header_enum['name'])
KeyError: 'name'
```

- Changed Code
	- This error generates when it is not defined the key of dictionary.
		- So define "empty" name as a default value when enum does not have the name.
	- super().__init__('enum', header_enum['name']) -> super().__init__('enum', header_enum.get('name',empty))
	- output
```
@startuml
enum empty {
	AAAAAAA
	BBBBBBB
}

@enduml
```
- if this class is not in namespace , we need to change the relationship expression
    - original)  .RegionExtBase *-- .EnvironmentVariant
    - expected) RegionExtBase *-- EnvironmentVariant
- if we remove start period(.) when this class is not in namespace , we can see the right plantuml.
@thibaultmarin
Copy link
Owner

I believe this was fixed in v0.8.4 (which I had never uploaded to PyPI, but should now be available). Could you please check with v0.8.4 and post an example hpp file if the issue is not resolved? Thanks

@thibaultmarin thibaultmarin force-pushed the master branch 5 times, most recently from b30bad2 to 0f72d6e Compare May 21, 2024 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants