Ejemplo n.º 1
0
def generatePage(account, gps):
    pageContents = p.getRow(p.getGPSBox(gps))

    pageContents += p.getRow(ndb.printNewLocationForm(account.email))

    # print all current locations
    locations = ndb.getAllLocations(account.email)
    for location in locations:
        pageContents += p.getRow(ndb.printCurrentLocationForm(location))

    return pageContents
Ejemplo n.º 2
0
    def get(self):
    	mainContents = """<div class='text-center'>
    					<h2 >Project Sparkles</h2>
    					<em><b>Automate your device, and carry on with your life!</b></em>
    					</div><br/>
    					<h5 class='text-primary'>What is Project Sparkles?</h5>
    					<b>Project Sparkles is a simple application that allows you to automate actions to speed up the setting up of your device.</b><br/><br/>
    					<h5 class='text-primary'>What actions are available?</h5>
    					<b><ul>
    					<li>Open websites.</li>
                        <li>Play music through spotify</li>
                        <li>More coming soon...</li>
    					</ul></b><br/>
    					<h5 class='text-primary'>How do you use it?</h5>
    					<b><ol>
    					<li>Sign into your Google account.</li>
    					<li>Connect any external accounts that you want to use.</li>
    					<li>Create profiles full of the actions that you want to automate.</li>
    					<li>Set the actions that you want to trigger each of the profiles.</li>
    					</ol></b><br/>
    					<h5 class='text-primary'>Got some feedback?</h5>
    					<b>If you have any feedback or suggestions for the project, please send an email to <a href='mailto:[email protected]'>[email protected]</a></b>"""

        pageContents = p.getRow(mainContents)

        self.response.write(p.getHeader("About", "/"))
        self.response.write(p.getContents(pageContents))
        self.response.write(p.getFooter())
Ejemplo n.º 3
0
def generatePage(account, gps):
    pageContents = p.getRow(p.getGPSBox(gps))
    error = 0
    if gps != "Not available.":
        profile = ndb.getGPSProfile(account.email, gps)
        error = 2
    else:
        profile = ndb.getDefaultProfile(account.email)
        error = 1
    if profile:
        pageContents += "<script>" + rs.generateProfileScript(profile) + "</script>"
        pageContents += "<br/><div class='text-center'><h4>Profile <em>" + profile.name + "</em> has been executed!</h4></div>"
        pageContents += p.getRow(ndb.printProfileList(profile, True))
    else:
        pageContents += ndb.noProfiles(error)
    return pageContents;
Ejemplo n.º 4
0
def generatePage(account):
    content = ndb.printNewProfileForm(account.email)

    # print all current profiles
    profiles = ndb.getAllProfiles(account.email)
    for profile in profiles:
        content += ndb.printCurrentProfileForm(profile)

    return p.getRow(content)
Ejemplo n.º 5
0
def generatePage(account):
    content = ""
    profiles = ndb.getAllProfiles(account.email)
    for profile in profiles:
        content += ndb.printProfileList(profile, False)
    if content == "":
        content += ndb.noProfiles(0)

    return p.getRow(content)
Ejemplo n.º 6
0
def generatePage(account):
    return p.getRow(ndb.printAccountForm(account))
Ejemplo n.º 7
0
def generateGetPage(account):
    pageContents = p.getRow(rs.getGPSJavascript(url))
    return pageContents