'Adding a variable string to an expression in Airium (Python)

I'm working on a little jig that generates a static gallery page based on a folder full of images. My current hangup is generating the HTML itself-

I used Airium to reverse-translate my existing HTML to Airium's python code, and added the variables I want to modify for each anchor tag in a loop. But I can't for the life of me figure out how to get it to let me add 'thumblink'. I'm not sure why it's treating it so differently from the others, my guess is that Airium expects foo:bar but not foo:bar(xyz) with xyz being the only part I want to pull out and modify.

from airium import Airium
imagelink = "image name here" # after pulling image filename from list
thumblink = "thumb link here" # after resizing image to thumb size
artistname = "artist name here" # after extracting artist name from filename
a = Airium()

with a.a(href='javascript:void(0);', **{'data-image': imagelink}):
    with a.div(klass='imagebox',  style='background-image:url(images/2015-12-29kippy.png)'):
        a.div(klass='artistname', _t= artistname)
html = str(a)  # cast to string
print(html) # print to console 

where "images/2015-12-29kippy.png" is what I'd replace with string variable "thumblink".

image and artist do translate correctly in the output after testing -

<a href="javascript:void(0);" data-image="image name here">
  <div class="imagebox" style="background-image:url(images/2015-12-29kippy.png)">
    <div class="artistname">artist name here</div>
  </div>
</a>
>>>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source