Example #1
0
    description = 'Hello, web'

print('''
<!doctype html>
    <html>
    <head>
      <title>PyWeb</title>
      <meta charset="utf-8">
    </head>
    <body>
      <h1><a href="index.py">WEB</a></h1>
      <ol>
        {listStr}
      </ol>
      <a href="create.py">create<a>
      <form action="process_update.py" method="post">
          <input type="hidden" name="pageId" value="{form_title}">
          <p><input type="text" placeholder="title" name="title" value="{form_title}"></P>
          <p><textarea rows="4" name="description">{form_description}</textarea></P>
          <p><input type="submit" value="submit"></p>
      </form>
      <h2>{title}</h2>
      <p>{desc}</p>
    </body>
</html>
'''.format(title=pageId,
           desc=description,
           listStr=getList(),
           form_title=pageId,
           form_description=description))
Example #2
0
<head>
  <meta charset="utf-8">
  <title>{users}</title>
  <link rel="stylesheet" href="style.css">
</head>

<body>
  <h1><a href='index.py'>{users}</a></h1>
  <div id='grid'>
    <ol>{fileList}</ol>

    <div id='article'>
    <a href='create.py'>creat</a>
    {update_link}
    {delete}
      <h2>{name}</h2>
      <p>{desc}</p>
    </div>
  </div>
</body>

</html>

'''.format(users='Python Page',
           name=pageId,
           desc=description,
           fileList=module.getList(),
           update_link=update_link,
           delete=delete_btn))
Example #3
0
<html>
<head>
  <title>Soul Seeker - 6th Knight Hero List</title>
  <meta charset="utf-8">
</head>

<body>
    <h1>Hero List</h1>
    <strong>Filter by...</strong>
    <br>
    {box}
    </select>
</body>
'''.format(box=box)




  <h1><a href="index.py">WEB</a></h1>
  <ol>{list}</ol>
  {create}
  {update}
  {delete}
  <h2>{title}</h2>
  <p>{desc}</p>

</body>
'''.format(title = cgi_data['pageId'], desc = cgi_data['desc'], 
           list = module.getList(), create = cgi_data['create'],
           update = cgi_data['update'], delete = cgi_data['delete']))
Example #4
0
if 'id' in form:
    pageId = form["id"].value
    description = open('data/'+pageId, 'r').read()
else:
    pageId = 'Welcome'
    description = 'Hello, web'

print('''
<!doctype html>
    <html>
    <head>
      <title>PyWeb</title>
      <meta charset="utf-8">
    </head>
    <body>
      <h1><a href="index.py">WEB</a></h1>
      <ol>
        {listStr}
      </ol>
      <a href="create.py">create<a>
      <form action="process_create.py" method="post">
          <p><input type="text" placeholder="title" name="title"></P>
          <p><textarea rows="4" name="description"></textarea></P>
          <p><input type="submit" value="submit"></p>
      </form>
      <h2>{title}</h2>
      <p>{desc}</p>
    </body>
</html>
'''.format(title=pageId, desc=description, listStr=getList()))