Skip to content

Conversation

@sauravsrijan
Copy link
Contributor

registers new icons, updates README, adds tests and a test svg icon.

registers new icons, updates README, adds tests and a test svg icon.

# Register method for a new icon.
@classmethod
def register(cls, symbol, svg_file):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a docstring for this method, which should explain what this method does and how it should be used. This is important since it's a public method.

doc = minidom.parse(svg_file)
path_strings = [path.getAttribute('d') for path
in doc.getElementsByTagName('path')]
path = '<path fill-rule="evenodd" d="'+path_strings[0]+'"'+"/>"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add comments for all these magic literals.

path = '<path fill-rule="evenodd" d="'+path_strings[0]+'"'+"/>"

values = {
'name': symbol,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent the key-value pairs one level.

}

OCTICON_DATA.update({symbol:values})
doc.unlink()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed? Please add a comment.

'path': path
}

OCTICON_DATA.update({symbol:values})
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function should return True if the registration is successful.

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