瀏覽代碼

Move get_ui_platform to a more appropriate place

oz123 11 年之前
父節點
當前提交
36963aa5a8
共有 2 個文件被更改,包括 32 次插入14 次删除
  1. 0 14
      pwman/__init__.py
  2. 32 0
      pwman/ui/__init__.py

+ 0 - 14
pwman/__init__.py

@@ -29,20 +29,6 @@ keywords = "password management sqlite crypto"
 import os
 
 
-def get_ui_platform(platform):
-    if 'darwin' in platform:
-        from ui.mac import PwmanCliMacNew as PwmanCliNew
-        OSX = True
-    elif 'win' in platform:
-        from ui.win import PwmanCliWinNew as PwmanCliNew
-        OSX = False
-    else:
-        from ui.cli import PwmanCliNew
-        OSX = False
-
-    return PwmanCliNew, OSX
-
-
 def which(cmd):
     _, cmdname = os.path.split(cmd)
 

+ 32 - 0
pwman/ui/__init__.py

@@ -0,0 +1,32 @@
+#============================================================================
+# This file is part of Pwman3.
+#
+# Pwman3 is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License, version 2
+# as published by the Free Software Foundation;
+#
+# Pwman3 is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Pwman3; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#============================================================================
+# Copyright (C) 2012 Oz Nahum <nahumoz@gmail.com>
+#============================================================================
+
+
+def get_ui_platform(platform):
+    if 'darwin' in platform:
+        from mac import PwmanCliMacNew as PwmanCliNew
+        OSX = True
+    elif 'win' in platform:
+        from win import PwmanCliWinNew as PwmanCliNew
+        OSX = False
+    else:
+        from cli import PwmanCliNew
+        OSX = False
+
+    return PwmanCliNew, OSX