Exemplo n.º 1
0
def file():
    theme = getTheme()
    tag = request.form.get('folder')

    path = setFilePath(tag)
    writeLog("Getting path")
    writeLog("Path: " + path)

    shortPath = setShortFilePath(tag)
    writeLog("Getting Short Path")
    writeLog("Short Path: " + shortPath)

    if request.method == 'POST':
        writeLog("Method is POST")
        if "upload" in request.form:
            writeLog("Calling Upload Function")
            upload(tag)
        elif "view" in request.form:
            writeLog("Calling View Function")
            path = setFilePath(tag)

    files = dir_listing(path)

    if tag == None:
        tag = "Documents"

    return render_template('upload.html',
                           files=files,
                           path=tag,
                           shortPath=shortPath,
                           theme=theme)
    def manager(self):

        self.managerList += [
            Manager(HorizontalContainer(
                [OneTimeButton(label="Continuar",
                               on_release=self.nextWindow)]),
                    window=self,
                    batch=self.batch,
                    theme=getTheme(),
                    anchor=ANCHOR_BOTTOM_RIGHT,
                    offset=(-80, 5),
                    is_movable=False)
        ]

        self.managerList += [
            Manager(VerticalContainer([
                Checkbox(label="El CPU Inicia        ",
                         on_press=self.setCPUStarts,
                         is_pressed=self.CPUStarts),
                Checkbox(label="El CPU es blancas",
                         on_press=self.setCPUPlayWhite,
                         is_pressed=self.CPUPlayWhite),
                Label(""),
                Label("Enroque de negras"),
                Checkbox(label="Lado de la Reina ",
                         on_press=self.setBlackQueenCastling,
                         is_pressed=self.blackQueenCastling),
                Checkbox(label="Lado del Rey       ",
                         on_press=self.setBlackKingCastling,
                         is_pressed=self.blackKingCastling),
                Label(""),
                Label("Enroque de blancas"),
                Checkbox(label="Lado de la Reina ",
                         on_press=self.setWhiteQueenCastling,
                         is_pressed=self.whiteQueenCastling),
                Checkbox(label="Lado del Rey       ",
                         on_press=self.setWhiteKingCastling,
                         is_pressed=self.whiteKingCastling)
            ]),
                    window=self,
                    batch=self.batch,
                    theme=getTheme(),
                    anchor=ANCHOR_RIGHT,
                    offset=(-50, -95),
                    is_movable=False)
        ]
Exemplo n.º 3
0
def music():
    # These functions are a straight ripped from file.py and modified for music player functionality
    theme = getTheme()
    mtag = request.form.get('folder')
    path = setFilePathMusic(mtag)
    if request.method == 'POST':
        if "upload" in request.form:
            upload(mtag)
        elif "view" in request.form:
            path = setFilePathMusic(mtag)

    files = dir_listing_music(path)

    if mtag == None:
        tag = "Music"

    theme = getTheme()
    return render_template('music.html', files=files, path=tag, theme=theme)
Exemplo n.º 4
0
 def manager(self):
     Manager(Label(""), window=self, batch=self.batch, theme=getTheme())
     Manager(Frame(self.document),
             window=self,
             batch=self.batch,
             theme=getTheme(),
             anchor=ANCHOR_TOP_RIGHT,
             offset=(-10, -75),
             is_movable=False)
     Manager(HorizontalContainer([
         OneTimeButton(label="Guardar", on_release=self.saveGame),
         OneTimeButton(label="Volver", on_release=self.onclose)
     ]),
             window=self,
             batch=self.batch,
             theme=getTheme(),
             anchor=ANCHOR_BOTTOM_RIGHT,
             offset=(-50, 15),
             is_movable=False)
     self.document.set_text("")
Exemplo n.º 5
0
def noteFunctions():
    theme = getTheme()
    ans = request.form['tag']  # determine which submit button was pressed
    if ans == "Save":
        filename = request.form['filename']
        data = request.form['notepad']
        NoteClass.saveNote(filename, data)
        return render_template('note.html',
                               text=data,
                               fn=filename,
                               theme=theme)
    if ans == "Load":
        filename = request.form['filename']
        data = NoteClass.loadNote(filename)
        return render_template('note.html',
                               text=data,
                               fn=filename,
                               theme=theme)
    if ans == "reset":
        return render_template('note.html',
                               text="New Note",
                               fn="Enter filename for save",
                               theme=theme)
Exemplo n.º 6
0
def notepad():
    theme = getTheme()
    return render_template('note.html',
                           text="New Note",
                           fn="Enter filename for save",
                           theme=theme)
Exemplo n.º 7
0
def my_form_post():
    theme = getTheme()
    text = request.form['txt']
    new_text = "You entered the word " + text
    return render_template('home.html', new_text=new_text, theme=theme)
Exemplo n.º 8
0
def calc():
    theme = getTheme()
    inp = request.form['display']  # pull expression from text field
    result = CalcClass.calculation(inp)
    return render_template('calc.html', result=result,
                           theme=theme)  # sends result to page
Exemplo n.º 9
0
def calcpage():
    theme = getTheme()
    return render_template('calc.html', theme=theme)
Exemplo n.º 10
0
def about():
    theme = getTheme()
    return render_template('about.html', theme=theme)
Exemplo n.º 11
0
def hello_world():
    theme = getTheme()
    return render_template('home.html', theme=theme)
Exemplo n.º 12
0
def game():
    theme = getTheme()
    return render_template('game.html', theme=theme)
Exemplo n.º 13
0
def news():
    theme = getTheme()
    return render_template('news.html', theme=theme)