Skip to content

Commit

Permalink
Update FlaskTest-0.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddhesh-Agarwal authored Jul 3, 2021
1 parent bdda92b commit 7970bba
Showing 1 changed file with 17 additions and 23 deletions.
40 changes: 17 additions & 23 deletions test/FlaskTest-0.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,41 @@ def the_template(): # Creating a simple template
def img_map():
the_template()
with div(None, attr="id='div_id'"): # Creating a <div> with id='div_id'

with image(src='workplace.jpg', attr="usemap='#workmap'") as i:
# Loading an image and giving it attr usemap
i.show() # Displaying the image
i.css(opacity=1.7) # Adding CSS to it

with open_tag('map', attr='name="workmap"'):

# Creating an image map which performs different actions
# based on where it is clicked, which is determined by
# specific shapes and coordinates on the image

# Loading an image and giving it attr usemap
i.show() # Displaying the image
i.css(opacity=1.7) # Adding CSS to it

with open_tag('map', attr='name="workmap"'):
# Creating an image map which performs different actions
# based on where it is clicked, which is determined by
# specific shapes and coordinates on the image
shape = ['rect', 'rect', 'circle']
coords = ["34,44,270,350", "290,172,333,250", "337,300,44"]
alt = ['Computer', 'Phone', 'Coffee']
href = ['computer.htm', 'phone.htm', 'coffee.htm']
# Using lists and for loop to make the shape and coordinate mapping faster (see doc)

# Using lists and for loop to make the shape and coordinate mapping faster (see doc)

for shape, coord, alt, href in zip(shapes, coords, alt, href):
for shape, coord, alt, href in zip(shape, coords, alt, href):
with open_tag('area', attr=f'shape="{shape}" coord="{coord}" alt="{alt}" href="{href}"'):
pass
autoPrettify()

autoPrettify()
write_to_template('index1.html')


def bulleted_and_des_list():
the_template()

with div(div_class='description_list'): # Creating div

a = [[['coffee', 'tea'], ['black coffee', 'black tea']], [['new_coffee'], ['foo', 'tea', 'green_tea']]]
# Displaying a description list
des_lists(a)
# Displaying a description list
des_lists(a)

with section(sec_class='unorder_list') as s: # Creating section inside div
ul_list = ['This', 'is', 'an', 'ul'] # Creating an unordered list
with bullets(ul=True, points=ul_list): # Displaying it
pass

autoPrettify()
write_to_template('index2.html')

Expand Down

0 comments on commit 7970bba

Please sign in to comment.