From 2ee87e7f327866ff2997b2d74ccca584385e2d8c Mon Sep 17 00:00:00 2001 From: Dmitry Moiseev Date: Thu, 7 Nov 2013 14:30:10 +0600 Subject: initial commit --- win32installer.iss | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 win32installer.iss diff --git a/win32installer.iss b/win32installer.iss new file mode 100644 index 0000000..0cec977 --- /dev/null +++ b/win32installer.iss @@ -0,0 +1,30 @@ +[Setup] +AppName=Parrot Zik Tray +AppVerName=Parrot Zik Tray 0.1 +AppPublisher=m0sia@m0sia.ru +AppPublisherURL=https://github.com/m0sia/pyParrotZik +DefaultDirName={pf}\ParrotZikTray +DefaultGroupName=ParrotZikTray +DisableProgramGroupPage=true +OutputBaseFilename=setup +Compression=lzma +SolidCompression=true +AllowUNCPath=false +VersionInfoVersion=0.1 +;VersionInfoCompany= +;VersionInfoDescription=handytool +;PrivilegeRequired=admin + +[Dirs] +Name: {app}; Flags: uninsalwaysuninstall; + +[Files] +Source: dist\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs + +[Icons] +Name: {group}\Parrot Zik Tray; Filename: {app}\ParrotZikTray.exe; WorkingDir: {app} + +[Run] +; If you are using GTK's built-in SVG support, uncomment the following line. +;Filename: {cmd}; WorkingDir: "{app}"; Parameters: "/C gdk-pixbuf-query-loaders.exe > lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"; Description: "GDK Pixbuf Loader Cache Update"; Flags: nowait runhidden +Filename: {app}\ParrotZikTray.exe; Description: {cm:LaunchProgram,Parrot Zik Tray}; Flags: nowait postinstall skipifsilent \ No newline at end of file -- cgit v1.2.1 From fe09ee5694030e465c29c60285ba9e86311423b4 Mon Sep 17 00:00:00 2001 From: Dmitry Moiseev Date: Thu, 7 Nov 2013 14:31:34 +0600 Subject: initial commit --- setup.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 setup.py diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..4db493a --- /dev/null +++ b/setup.py @@ -0,0 +1,31 @@ +from distutils.core import setup +import glob +import py2exe + +setup( + name = 'parrotziktray', + description = 'Parrot Zik Tray', + version = '0.1', + + windows = [ + { + 'script': 'ParrotZikTray.py', + 'icon_resources': [(1, "./icons/Headphone.ico")], + } + ], + + options = { + 'py2exe': { + #'packages':'encodings', + # Optionally omit gio, gtk.keysyms, and/or rsvg if you're not using them + 'includes': 'cairo, pango, pangocairo, atk, gobject, gio, gtk.keysyms, _winreg', + } + }, + + data_files=[ + ("icons", glob.glob("icons/*.png")) + # If using GTK+'s built in SVG support, uncomment these + #os.path.join(gtk_base_path, '..', 'runtime', 'bin', 'gdk-pixbuf-query-loaders.exe'), + #os.path.join(gtk_base_path, '..', 'runtime', 'bin', 'libxml2-2.dll'), + ] +) \ No newline at end of file -- cgit v1.2.1 From e56dacc4d3e15b4d82ea1553bd73af6221dfcc6c Mon Sep 17 00:00:00 2001 From: Dmitry Moiseev Date: Thu, 7 Nov 2013 14:32:58 +0600 Subject: connection lost quick fix --- ParrotZik.py | 9 +++++++-- icons/Headphone.ico | Bin 0 -> 112262 bytes icons/audio-headset.png | Bin 0 -> 2885 bytes icons/battery-040.png | Bin 0 -> 2424 bytes icons/battery-060.png | Bin 0 -> 2537 bytes icons/battery-080.png | Bin 0 -> 2617 bytes icons/battery-100.png | Bin 0 -> 2603 bytes icons/battery-caution-3.png | Bin 0 -> 1587 bytes icons/battery-low.png | Bin 0 -> 2334 bytes 9 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 icons/Headphone.ico create mode 100644 icons/audio-headset.png create mode 100644 icons/battery-040.png create mode 100644 icons/battery-060.png create mode 100644 icons/battery-080.png create mode 100644 icons/battery-100.png create mode 100644 icons/battery-caution-3.png create mode 100644 icons/battery-low.png diff --git a/ParrotZik.py b/ParrotZik.py index 2746259..05e316e 100644 --- a/ParrotZik.py +++ b/ParrotZik.py @@ -13,7 +13,8 @@ class ParrotZik(object): if len(service_matches) == 0: print "Couldn't find Parrot Zik" - return False + self.sock = '' + return first_match = service_matches[0] port = first_match["port"] @@ -86,7 +87,11 @@ class ParrotZik(object): return self.sendMessage(message) def sendMessage(self,message): - self.sock.send(str(message)) + try: + self.sock.send(str(message)) + except: + self.sock = '' + return data = self.sock.recv(7) len = struct.unpack('B', data[1])[0] data = self.sock.recv(1024) diff --git a/icons/Headphone.ico b/icons/Headphone.ico new file mode 100644 index 0000000..0bddf34 Binary files /dev/null and b/icons/Headphone.ico differ diff --git a/icons/audio-headset.png b/icons/audio-headset.png new file mode 100644 index 0000000..42164bb Binary files /dev/null and b/icons/audio-headset.png differ diff --git a/icons/battery-040.png b/icons/battery-040.png new file mode 100644 index 0000000..333e699 Binary files /dev/null and b/icons/battery-040.png differ diff --git a/icons/battery-060.png b/icons/battery-060.png new file mode 100644 index 0000000..5d21461 Binary files /dev/null and b/icons/battery-060.png differ diff --git a/icons/battery-080.png b/icons/battery-080.png new file mode 100644 index 0000000..83fa2fa Binary files /dev/null and b/icons/battery-080.png differ diff --git a/icons/battery-100.png b/icons/battery-100.png new file mode 100644 index 0000000..0e818c3 Binary files /dev/null and b/icons/battery-100.png differ diff --git a/icons/battery-caution-3.png b/icons/battery-caution-3.png new file mode 100644 index 0000000..f97b54c Binary files /dev/null and b/icons/battery-caution-3.png differ diff --git a/icons/battery-low.png b/icons/battery-low.png new file mode 100644 index 0000000..86546be Binary files /dev/null and b/icons/battery-low.png differ -- cgit v1.2.1