Skip to content

Commit

Permalink
improved sytnax highlighting for CWR 3
Browse files Browse the repository at this point in the history
  • Loading branch information
matijakolaric committed Jan 12, 2021
1 parent 3b90158 commit d24e68d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
17 changes: 12 additions & 5 deletions music_publisher/templates/raw_cwr.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
.cwr div.WRI span.ipnumber,
.cwr div.SWR span.ipnumber,
.cwr div.SWT span.ipnumber,
.cwr div.MAN span.ipnumber,
.cwr div.OWR span.ipnumber,
.cwr div.OWT span.ipnumber,
.cwr div.PWR span.ipnumber:last-of-type,
Expand Down Expand Up @@ -95,20 +96,26 @@
<div class="readonly cwr">
{% for line in lines %}{% with line|slice:'0:3' as rt %}
{% if version == '30' or version == '31' %}
{% if rt == 'HDR' or rt == 'TRL' or rt == 'GRH' or rt == 'GRT' %}
<div class="{{ rt }}"><pre><span class="record_type">{{ rt }}</span>{{ line|slice:'3:' }}</pre></div>
{% if rt == 'HDR' %}
<div class="{{ rt }}"><pre><span class="record_type">{{ rt }}</span>{{ line|slice:'3:5' }}<span class="ipnumber" title="Sender code">{{ line|slice:'5:9' }}</span><span class="publisher" title="Sender">{{ line|slice:'9:54' }}</span>{{ line|slice:'54:' }}</pre></div>
{% elif rt == 'GRH' %}
<div class="{{ rt }}"><pre><span class="record_type">{{ rt }}</span><span class="title" title="Group type">{{ line|slice:'3:6' }}</span><span class="counters">{{ line|slice:'6:' }}</span></pre></div>
{% elif rt == 'TRL' or rt == 'GRT' %}
<div class="{{ rt }}"><pre><span class="record_type">{{ rt }}</span><span class="counters">{{ line|slice:'3:' }}</span></pre></div>
{% elif rt == 'WRK' or rt == 'ISR' %}
<div class="{{ rt }}"><pre><span class="record_type">{{ rt }}</span><span class="counters">{{ line|slice:'3:19' }}</span><span class="title" title="Work title">{{ line|slice:'19:79' }}</span>{{ line|slice:'79:' }}</pre></div>
<div class="{{ rt }}"><pre><span class="record_type">{{ rt }}</span><span class="counters">{{ line|slice:'3:19' }}</span><span class="title" title="Work title">{{ line|slice:'19:79' }}</span><span class="workid" title="Work ID">{{ line|slice:'79:93' }}</span>{{ line|slice:'93:95' }}<span class="iswc" title="ISWC">{{ line|slice:'95:106' }}</span>{{ line|slice:'106:129' }}<span class="duration" title="Duration: {% if line|slice:'129:135' == '000000' %}Unknown{% else %}{{ line|slice:'129:131' }}h{{ line|slice:'131:133' }}m{{ line|slice:'133:135' }}s{% endif %}">{{ line|slice:'129:135' }}</span><span class="flag" title="Recorded indicator: {{ line|slice:'135:136'|flag }}">{{ line|slice:'135:136' }}</span>{{ line|slice:'136:142' }}<span class="flag" title="Version type: {{ line|slice:'142:145'|orimod }}">{{ line|slice:'142:145' }}</span>{{ line|slice:'145:' }}</pre></div>
{% elif rt == 'SPU' or rt == 'OPU' %}
<div class="{{ rt }}"><pre><span class="record_type">{{ rt }}</span><span class="counters">{{ line|slice:'3:19' }}</span><span class="chain" title="Publisher sequence">{{ line|slice:'19:21' }}</span><span class="ipnumber" title="Publisher IP number">{{ line|slice:'21:30' }}</span><span class="publisher" title="Publisher">{{ line|slice:'30:75' }}</span>{{ line|slice:'75:76' }}<span class="capacity" title="Capacity: Original publisher">{{ line|slice:'76:78' }}</span>{{ line|slice:'78:' }}</pre></div>
<div class="{{ rt }}"><pre><span class="record_type">{{ rt }}</span><span class="counters">{{ line|slice:'3:19' }}</span><span class="chain" title="Publisher sequence">{{ line|slice:'19:21' }}</span><span class="ipnumber" title="Publisher IP number">{{ line|slice:'21:30' }}</span><span class="publisher" title="Publisher">{{ line|slice:'30:75' }}</span>{{ line|slice:'75:76' }}<span class="capacity" title="Capacity: Original publisher">{{ line|slice:'76:78' }}</span>{{ line|slice:'78:87' }}<span class="publisher" title="IPI Name #">{{ line|slice:'87:98' }}{{ line|slice:'98:' }}</span></pre></div>
{% elif rt == 'SWR' or rt == 'OWR' %}
<div class="{{ rt }}"><pre><span class="record_type">{{ rt }}</span><span class="counters">{{ line|slice:'3:19' }}</span><span class="ipnumber" title="Writer IP number">{{ line|slice:'19:28' }}</span><span class="writer" title="Writer">{{ line|slice:'28:103' }}</span>{{ line|slice:'103:104' }}<span class="capacity" title="Capacity: {{ line|slice:'104:106'|capacity }}">{{ line|slice:'104:106' }}</span>{{ line|slice:'106:' }}</pre></div>
<div class="{{ rt }}"><pre><span class="record_type">{{ rt }}</span><span class="counters">{{ line|slice:'3:19' }}</span><span class="ipnumber" title="Writer IP number">{{ line|slice:'19:28' }}</span><span class="writer" title="Writer">{{ line|slice:'28:103' }}</span>{{ line|slice:'103:104' }}<span class="capacity" title="Capacity: {{ line|slice:'104:106'|capacity }}">{{ line|slice:'104:106' }}</span>{{ line|slice:'106:115' }}<span class="writer" title="IPI Name #">{{ line|slice:'115:126' }}</span>{{ line|slice:'126:' }}</pre></div>
{% elif rt == 'WRI' %}
<div class="{{ rt }}"><pre><span class="record_type">{{ rt }}</span><span class="counters">{{ line|slice:'3:19' }}</span><span class="ipnumber" title="Writer IP number">{{ line|slice:'19:28' }}</span>{{ line|slice:'28:39' }}<span class="writer" title="Writer">{{ line|slice:'39:114' }}</span><span class="capacity" title="Capacity: {{ line|slice:'114:116'|capacity }}">{{ line|slice:'114:116' }}</span>{{ line|slice:'116:' }}</pre></div>
{% elif rt == 'SPT' or rt == 'OPT' %}
<div class="{{ rt }}"><pre><span class="record_type">{{ rt }}</span><span class="counters">{{ line|slice:'3:22' }}</span><span class="ipnumber" title="Publisher IP number">{{ line|slice:'22:31' }}</span><span class="prshare" title="Performance share: {{ line|slice:'31:36'|perc }}">{{ line|slice:'31:36' }}</span><span class="mrshare" title="Mechanical share: {{ line|slice:'36:41'|perc }}">{{ line|slice:'36:41' }}</span><span class="srshare" title="Sync share: {{ line|slice:'41:46'|perc }}">{{ line|slice:'41:46' }}</span>{{ line|slice:'46:51' }}<span class="prshare" title="Perf. affiliation: {{ line|slice:'51:55'|soc_name }}">{{ line|slice:'51:55' }}</span><span class="mrshare" title="Mech. affiliation: {{ line|slice:'55:59'|soc_name }}">{{ line|slice:'55:59' }}</span><span class="srshare" title="Sync affiliation: {{ line|slice:'59:63'|soc_name }}">{{ line|slice:'59:63' }}</span>{{ line|slice:'63:' }}</pre></div>
{% elif rt == 'SWT' or rt == 'OWT'%}
<div class="{{ rt }}"><pre><span class="record_type">{{ rt }}</span><span class="counters">{{ line|slice:'3:22' }}</span><span class="ipnumber" title="Writer IP number">{{ line|slice:'22:31' }}</span><span class="prshare" title="Performance share: {{ line|slice:'31:36'|perc }}">{{ line|slice:'31:36' }}</span><span class="mrshare" title="Mechanical share: {{ line|slice:'36:41'|perc }}">{{ line|slice:'36:41' }}</span><span class="srshare" title="Sync share: {{ line|slice:'41:46'|perc }}">{{ line|slice:'41:46' }}</span>{{ line|slice:'46:51' }}<span class="prshare" title="Perf. affiliation: {{ line|slice:'51:55'|soc_name }}">{{ line|slice:'51:55' }}</span><span class="mrshare" title="Mech. affiliation: {{ line|slice:'55:59'|soc_name }}">{{ line|slice:'55:59' }}</span><span class="srshare" title="Sync affiliation: {{ line|slice:'59:63'|soc_name }}">{{ line|slice:'59:63' }}</span>{{ line|slice:'63:' }}</pre></div>
{% elif rt == 'MAN' %}
<div class="{{ rt }}"><pre><span class="record_type">{{ rt }}</span><span class="counters">{{ line|slice:'3:19' }}</span><span class="ipnumber" title="Writer IP number">{{ line|slice:'19:28' }}</span><span class="prshare" title="Performance share: {{ line|slice:'28:33'|perc }}">{{ line|slice:'28:33' }}</span><span class="mrshare" title="Mechanical share: {{ line|slice:'33:38'|perc }}">{{ line|slice:'33:38' }}</span><span class="srshare" title="Sync share: {{ line|slice:'38:43'|perc }}">{{ line|slice:'38:43' }}</span>{{ line|slice:'43:' }}</pre></div>
{% elif rt == 'PWR' %}
<div class="{{ rt }}"><pre><span class="record_type">{{ rt }}</span><span class="counters">{{ line|slice:'3:19' }}</span><span class="chain" title="Publisher sequence">{{ line|slice:'19:21' }}</span><span class="ipnumber" title="Publisher IP number">{{ line|slice:'21:30' }}</span><span class="ipnumber" title="Writer IP number">{{ line|slice:'30:39' }}</span>{{ line|slice:'39:71' }}<span class="chain" title="Agreement Type: {{ line|slice:'71:73'|agreement_type }}">{{ line|slice:'71:73' }}</span>{{ line|slice:'73:' }}</pre></div>
{% elif rt == 'ALT' %}
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name='django-music-publisher',
version='21.1rc1',
version='21.1',
author='Matija Kolarić',
author_email='[email protected]',
license='MIT License',
Expand All @@ -32,15 +32,16 @@
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'Intended Audience :: Developers',
'Intended Audience :: Other Audience',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
zip_safe=False,
)

0 comments on commit d24e68d

Please sign in to comment.