Skip to content

Commit

Permalink
Init PyQt GUI
Browse files Browse the repository at this point in the history
Ready for editing to be a workable GUI for the users.
  • Loading branch information
justanotherspy committed Apr 25, 2020
1 parent af01aef commit 29a3e63
Showing 1 changed file with 40 additions and 20 deletions.
60 changes: 40 additions & 20 deletions generator.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#!/usr/bin/env python3

# import qrcode
# import uuid
# import requests
# import boto3
# import urllib.parse
import uuid
import json
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QLabel
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import pyqtSlot

access_key = ""
secret_key = ""
Expand All @@ -16,22 +20,38 @@
secret_key = data['aws_secret_access_key']
api_key = data['api_key']

# id = str(uuid.uuid4())[:8]

# name = input("Name of doll: ")
# encoded_name = urllib.parse.quote_plus(name)
# description = input("Enter a description (not long): ")
# encoded_description = urllib.parse.quote_plus(description)

# try:
# r = requests.get("https://y5p8e6kmgf.execute-api.us-east-1.amazonaws.com/prod/generate?id=" + id + "&name=" + encoded_name + "&description=" + encoded_description)
# img = qrcode.make('https://verify.moxandlouise.com/#'+id)
# img.save("./qrcodes/" + name + '.png')
# bucketName = "verify.moxandlouise.com"
# s3 = boto3.client('s3', aws_access_key_id=access_key, aws_secret_access_key=secret_key)
# key = "./images/" + name + ".jpeg"
# output = "images/" + name + ".jpeg"
# s3.upload_file(key, bucketName, output, ExtraArgs={'ACL':'public-read'})
# except Exception as e:
# print(e)

def main():

id = str(uuid.uuid4())[:8]

app = QApplication(sys.argv)
widget = QWidget()

textLabel = QLabel(widget)
textLabel.setText("Hello World!")
textLabel.move(110,85)

widget.setGeometry(50,50,320,200)
widget.setWindowTitle("PyQt5 Example")
widget.show()
sys.exit(app.exec_())

# name = input("Name of doll: ")
# encoded_name = urllib.parse.quote_plus(name)
# description = input("Enter a description (not long): ")
# encoded_description = urllib.parse.quote_plus(description)

# try:
# r = requests.get("https://y5p8e6kmgf.execute-api.us-east-1.amazonaws.com/prod/generate?id=" + id + "&name=" + encoded_name + "&description=" + encoded_description)
# img = qrcode.make('https://verify.moxandlouise.com/#'+id)
# img.save("./qrcodes/" + name + '.png')
# bucketName = "verify.moxandlouise.com"
# s3 = boto3.client('s3', aws_access_key_id=access_key, aws_secret_access_key=secret_key)
# key = "./images/" + name + ".jpeg"
# output = "images/" + name + ".jpeg"
# s3.upload_file(key, bucketName, output, ExtraArgs={'ACL':'public-read'})
# except Exception as e:
# print(e)

if __name__ == '__main__':
main()

0 comments on commit 29a3e63

Please sign in to comment.