Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
django-iconify
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Libraries
django-iconify
Commits
cc341fba
Verified
Commit
cc341fba
authored
4 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Add stubs for Iconify tpyes
parent
bbb6ce45
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dj_iconify/types.py
+56
-0
56 additions, 0 deletions
dj_iconify/types.py
with
56 additions
and
0 deletions
dj_iconify/types.py
0 → 100644
+
56
−
0
View file @
cc341fba
"""
Iconify data types used in API.
Documentation: https://docs.iconify.design/types/
"""
from
typing
import
Dict
,
Optional
class
IconifyOptional
:
left
:
int
=
0
top
:
int
=
0
width
:
int
=
16
height
:
int
=
16
rotate
:
int
=
0
h_flip
:
bool
=
False
v_flip
:
bool
=
False
def
_as_dict_optoinal
(
self
):
return
{
"
left
"
:
self
.
left
,
"
top
"
:
self
.
top
,
"
width
"
:
self
.
width
,
"
height
"
:
self
.
height
,
"
rotate
"
:
self
.
rotate
,
"
hFlip
"
:
self
.
h_flip
,
"
vFlip
"
:
self
.
v_flip
,
}
class
IconifyIcon
(
IconifyOptional
):
body
:
str
def
as_dict
(
self
):
return
{
"
body
"
:
self
.
body
,
}.
update
(
self
.
_as_dict_optional
())
class
IconifyAlias
(
IconifyOptional
):
parent
:
str
def
as_dict
(
self
):
return
{
"
parent
"
:
self
.
parent
,
}.
update
(
self
.
_as_dict_optional
())
class
IconifyJSON
(
IconifyOptional
):
prefix
:
str
icons
:
Dict
[
str
,
IconifyIcon
]
aliases
:
Optional
[
Dict
[
str
,
IconifyAlias
]]
def
as_dict
(
self
):
return
{
"
prefix
"
:
self
.
prefix
,
"
icons
"
:
{
name
:
icon
.
as_dict
()
for
name
,
icon
in
self
.
icons
},
"
aliases
"
:
{
name
:
alias
.
as_dict
()
for
name
,
alias
in
self
.
aliases
},
}.
update
(
self
.
_as_dict_optional
())
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment