mirror of
https://github.com/lalbornoz/roar.git
synced 2024-11-26 08:56:36 +00:00
libcanvas/Canvas.py, libgui/GuiCanvasInterface.py: correctly set ImgurApiKey.
libcanvas/CanvasExportStore.py:_exportFileToImgur(): fixed. libcanvas/CanvasExportStore.py:exportPastebin(): fixed.
This commit is contained in:
parent
bffcc644f2
commit
80ff03e4b1
@ -8,7 +8,6 @@ from CanvasBackend import CanvasBackend
|
||||
from CanvasJournal import CanvasJournal
|
||||
from CanvasExportStore import CanvasExportStore, havePIL, haveUrllib
|
||||
from CanvasImportStore import CanvasImportStore
|
||||
from ImgurApiKey import ImgurApiKey
|
||||
import wx
|
||||
|
||||
class Canvas(wx.Panel):
|
||||
@ -177,7 +176,6 @@ class Canvas(wx.Panel):
|
||||
self._canvasDirty, self._canvasDirtyCursor = False, False
|
||||
self.canvasMap, self.canvasPos, self.canvasSize, = None, defaultCanvasPos, defaultCanvasSize
|
||||
self.defaultCanvasPos, self.defaultCanvasSize, self.defaultCellSize = defaultCanvasPos, defaultCanvasSize, defaultCellSize
|
||||
self.imgurApiKey = ImgurApiKey.imgurApiKey
|
||||
self.parentFrame = parentFrame
|
||||
self.parentFrame.onCanvasUpdate(brushSize=self.brushSize, colours=self.brushColours)
|
||||
|
||||
|
@ -49,7 +49,7 @@ class CanvasExportStore():
|
||||
"title": imgTitle, \
|
||||
"type": "base64"}
|
||||
requestHeaders = {"Authorization": "Client-ID " + apiKey}
|
||||
responseHttp = requests.post(ImgurUploadUrl, data=requestData, headers=requestHeaders)
|
||||
responseHttp = requests.post(self.ImgurUploadUrl, data=requestData, headers=requestHeaders)
|
||||
responseDict = json.loads(responseHttp.text)
|
||||
if responseHttp.status_code == 200:
|
||||
return [200, responseDict.get("data").get("link")]
|
||||
@ -105,7 +105,7 @@ class CanvasExportStore():
|
||||
"api_paste_code": outFile.getvalue().encode(), \
|
||||
"api_paste_name": pasteName, \
|
||||
"api_paste_private": pastePrivate}
|
||||
responseHttp = requests.post(PastebinPostUrl, data=requestData)
|
||||
responseHttp = requests.post(self.PastebinPostUrl, data=requestData)
|
||||
if responseHttp.status_code == 200:
|
||||
if responseHttp.text.startswith("http"):
|
||||
return (True, responseHttp.text)
|
||||
|
@ -14,6 +14,7 @@ from ToolText import ToolText
|
||||
|
||||
from glob import glob
|
||||
from GuiCanvasInterfaceAbout import GuiCanvasInterfaceAbout
|
||||
from ImgurApiKey import ImgurApiKey
|
||||
import io, os, random, wx, wx.adv
|
||||
|
||||
class GuiCanvasInterface():
|
||||
@ -425,7 +426,7 @@ class GuiCanvasInterface():
|
||||
#
|
||||
# __init__(self, parentCanvas, parentFrame):
|
||||
def __init__(self, parentCanvas, parentFrame):
|
||||
self.canvasPathName, self.imgurApiKey = None, None
|
||||
self.canvasPathName, self.imgurApiKey = None, ImgurApiKey.imgurApiKey
|
||||
self.parentCanvas, self.parentFrame = parentCanvas, parentFrame
|
||||
self.canvasToolRect(None)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user