Skip to content

Commit

Permalink
avatar değiştirilemediğinden oluşan hata giderildi.
Browse files Browse the repository at this point in the history
  • Loading branch information
mthnzbk committed Jun 3, 2016
1 parent eccddc5 commit 786017a
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions kaptan5/libkaptan/ui_avatar.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ def buttonCamChanged(self):
self.buttonCam.hide()
self.buttonReplay.show()
self.camera.searchAndLock()
self.cameraImageCapture.capture("/tmp/avatar.png")
self.cameraImageCapture.capture("/tmp/avatar")
self.camera.unlock()
self.userAvatar = "/tmp/avatar.png"
self.userAvatar = "/tmp/avatar.jpg"

def buttonReplayChanged(self):
self.userAvatar = None
Expand All @@ -168,7 +168,13 @@ def imageCapture(self, id, preview):
self.cameraLabel.setPixmap(pixmap)

def execute(self):
if self.userAvatar:
if os.path.exists(os.path.join(os.environ["HOME"], ".face.icon")):
os.remove(os.path.join(os.environ["HOME"], ".face.icon"))
shutil.copy(self.userAvatar, os.path.join(os.environ["HOME"], ".face.icon"))
try:
if self.userAvatar:
if os.path.exists(os.path.join(os.environ["HOME"], ".face.icon")):
os.remove(os.path.join(os.environ["HOME"], ".face.icon"))
shutil.copy(self.userAvatar, os.path.join(os.environ["HOME"], ".face.icon"))
os.remove(self.userAvatar)
except:
with open("/tmp/.kaptan.bug", "w") as d:
d.write("avatar değiştirilemedi.")
d.close()

0 comments on commit 786017a

Please sign in to comment.