Merge pull request #314 from cuu/master

warehouse bug fix of adding URL repeatedly
This commit is contained in:
GNU 2019-12-25 14:16:48 +08:00 committed by GitHub
commit 708c863a33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -960,23 +960,28 @@ class GameStorePage(Page):
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
else:
valid_url= self.raw_github_com(inputed)
if valid_url == False:
if "github.com/clockworkpi/warehouse" in inputed:
self._Screen._MsgBox.SetText("Warehouse existed!")
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
else:
sql_insert = """ INSERT INTO warehouse(title,file,type) VALUES(
valid_url= self.raw_github_com(inputed)
if valid_url == False:
self._Screen._MsgBox.SetText("Warehouse url error!")
self._Screen._MsgBox.Draw()
self._Screen.SwapAndShow()
else:
sql_insert = """ INSERT INTO warehouse(title,file,type) VALUES(
'%s',
'%s',
'source');""" % (inputed,valid_url)
c.execute(sql_insert)
conn.commit()
self.SyncList()
self._Screen.Draw()
self._Screen.SwapAndShow()
c.execute(sql_insert)
conn.commit()
self.SyncList()
self._Screen.Draw()
self._Screen.SwapAndShow()
conn.close()
except Exception as ex:
print(ex)