Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
UltraStar_Lib_Checker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSR VI
FSR Projekte
UltraStar_Lib_Checker
Merge requests
!4
fixed: Ultrastarsongfile
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
fixed: Ultrastarsongfile
ultrastarsongfile-fix
into
master
Overview
0
Commits
3
Changes
1
Merged
kjk
requested to merge
ultrastarsongfile-fix
into
master
5 years ago
Overview
0
Commits
3
Changes
1
Expand
0
0
Merge request reports
Viewing commit
b6d991bd
Prev
Next
Show latest version
1 file
+
10
−
3
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
b6d991bd
changed docstring and added eq operator
· b6d991bd
kjk
authored
5 years ago
ultrastarsongfile.py
+
32
−
7
Options
@@ -29,26 +29,51 @@ class UltraStarSongFile:
# Misc Shit
self
.
resolution
=
""
self
.
id
=
""
# Custom Tags
self
.
duett
=
""
# Other
self
.
start
=
""
self
.
notesgap
=
""
self
.
relative
=
""
self
.
medleystartbeat
=
""
self
.
medleyendbeat
=
""
self
.
calcmedley
=
""
self
.
duetsingerp1
=
""
self
.
duetsingerp2
=
""
self
.
p1
=
""
self
.
p2
=
""
#Database Information
self
.
songid
=
""
self
.
artistid
=
""
self
.
albumid
=
""
# Custom Tags
self
.
duett
=
""
self
.
custom_tags
=
[]
# Songdata
self
.
songdata
=
[]
# list of lines with songdata
def
__eq__
(
self
,
other
):
if
isinstance
(
other
,
self
.
__class__
):
if
self
.
songid
==
""
or
other
.
songid
==
""
:
return
(
self
.
title
==
other
.
title
)
and
(
self
.
artist
==
other
.
artist
)
and
(
self
.
duett
==
other
.
duett
)
else
:
return
self
.
songid
==
other
.
songid
def
set_attributes
(
self
,
parsed_data
:
dict
)
->
None
:
"""
Setzt die attribute der
k
lasse
Setzt die attribute der
K
lasse
@param parsed_data: dict mit den geparseden tags und einem key
"
songdata
"
der eine liste,
mit den Text/Tonhöhe Zeilen enthält
Args:
parsed_data: dict mit den geparseden tags und einem key
"
songdata
"
der eine liste,
mit den Text/Tonhöhe Zeilen enthält
"""
k
:
str
v
:
str
for
k
,
v
in
parsed_data
.
iteritems
():
setattr
(
self
,
k
.
lower
(),
v
)
for
k
,
v
in
parsed_data
.
items
():
if
hasattr
(
self
,
k
.
lower
()):
setattr
(
self
,
k
.
lower
(),
v
)
else
:
self
.
custom_tags
.
append
({
k
,
v
})
print
(
f
"
got custom tag:
{
k
}
"
)
Loading