Browse Source

add other system to open, and motify mac

chao xu 9 years ago
parent
commit
4822870f68
1 changed files with 4 additions and 8 deletions
  1. 4 8
      wxbot.py

+ 4 - 8
wxbot.py

@@ -26,15 +26,11 @@ def show_image(file):
     else:
         from pipes import quote
 
-    if sys.platform == "win32":
+    if sys.platform == "darwin":
+        command = "open -a /Applications/Preview.app %s&" % quote(file)
+        os.system(command)
+    else :
         webbrowser.open(file)
-    elif sys.platform == "darwin":
-        def get_command(file, **options):
-            command = "open -a /Applications/Preview.app"
-            command = "(%s %s)&" % (command, quote(file))
-            return command
-
-        os.system(get_command(file))
 
 class WXBot:
     """WXBot, a framework to process WeChat messages"""