#import re #import sickgear #from sickgear import TVInfoAPI #from sickgear.helpers import anon_url #from sickgear.tv import PersonGenders #from six import iteritems <% def sg_var(varname, default=False): return getattr(sickgear, varname, default) %>#slurp# <% def sg_str(varname, default=''): return getattr(sickgear, varname, default) %>#slurp# ## #set global $title = 'Character' #if $character.name #set global $title = $character.name + ' (Character)' #end if #set global $header = 'Character' #set global $sbPath = '../..' #set global $topmenu = 'Character' #set $css = $getVar('css', 'reg') #set global $page_body_attr = 'cast-role" class="' + $css ## #import os.path #set global $inc_ofi = True #include $os.path.join($sg_str('PROG_DIR'), 'gui/slick/interfaces/default/inc_top.tmpl') #if $varExists('header')

$header

#else

$title

#end if ## #set $html_selected = ' selected="selected"' #set $html_checked = ' checked="checked"' <% def param(visible=True, rid=None, cache_person=None, cache_char=None, person=None, role=None, tvid_prodid=None, thumb=None, oid=None, pid=None): """ make the url param list """ if cache_char or role: oid = ('oid=%s' % oid, '')[not visible or None is oid or str(rid) == str(oid)] return ('imagecache/character?', '')[not cache_char] + '&'.join([kv for kv in ('rid=%s' % rid, 'tvid_prodid=%s' % (cache_char or role).tvid_prodid, ('', 'thumb=%s' % thumb)[not role and None is not thumb], ('person_id=%s' % pid, '')[not pid], ('prefer_person=1', '')[not pid], oid) if kv]) if cache_person: oid = ('oid=%s' % oid, '')[not visible or None is oid or str(rid) == str(oid)] return 'imagecache/person?' + '&'.join([kv for kv in ('pid=%s' % rid, ('', 'thumb=%s' % thumb)[None is not thumb], oid) if kv]) if person: oid = ('oid=%s' % person.id, '')[not visible or str(person.ref_id()) == str(person.id)] return '&'.join([kv for kv in ('rid=%s' % person.ref_id(), oid) if kv]) return 'param not implemented properly' %>

$character.name

#if $character.person #set $num_people = len($character.person) #set $rc_clean = re.compile(r'(?i)[^a-z0-9]')
portrayed by #for $cur_enum, $cur_person in enumerate($character.person, 1) #set $gender = 'themself' #if $PersonGenders.female == $cur_person.gender# #set $gender = 'herself' #elif $PersonGenders.male == $cur_person.gender# #set $gender = 'himself' #end if# #set $name = ($cur_person.name, $gender)[$rc_clean.sub('', $cur_person.name.lower()) == $rc_clean.sub('', ($character.name or 'unknown name').lower())] $name#if 2 <= $num_people and $cur_enum + 1 == $num_people# and #elif 2 < $num_people and $cur_enum < $num_people#, #end if# #end for
#end if
is known in your show list as,
#for $cur_char in $roles
#set $cid_param = ('', '&cid=%s' % $cur_char['character_id'])[$cur_char['character_id'] != $cur_char['character_rid']]
#if $character.show_obj.tvid_prodid != $cur_char['show_obj'].tvid_prodid

$cur_char['character_name'] #else

$cur_char['character_name'] #end if in $cur_char['show_obj'].name #if 1 < $len($character.person)# by $cur_char.person_name#end if#

#end for
#set $section_links = False #for $cur_src, $cur_sid in sorted(iteritems($character.ids)) #if $TVInfoAPI($cur_src).config.get('character_url') #if not $section_links #set $section_links = True
Links
#end if #if $character.biography

Bio

## cleanup bio

$re.sub(r'\s+.*?CC-BY-SA.*?$', '', $character.biography).replace('\n', '
')

#end if
#include $os.path.join($sg_str('PROG_DIR'), 'gui/slick/interfaces/default/inc_bottom.tmpl')