[Uludag-commits] r14658 - trunk/staj-projeleri/migration-tool
uludag-commits at pardus.org.tr
uludag-commits at pardus.org.tr
2 Tem 2007 Pzt 17:03:17 EEST
Author: muratongan
Date: Mon Jul 2 17:03:17 2007
New Revision: 14658
Added:
trunk/staj-projeleri/migration-tool/options.py
trunk/staj-projeleri/migration-tool/user.py
trunk/staj-projeleri/migration-tool/user.ui
trunk/staj-projeleri/migration-tool/user_ui.py
trunk/staj-projeleri/migration-tool/wizard.py
Modified:
trunk/staj-projeleri/migration-tool/migration.py
trunk/staj-projeleri/migration-tool/modules.py
trunk/staj-projeleri/migration-tool/partition.py
Log:
Graphical User Interface
Modified: trunk/staj-projeleri/migration-tool/migration.py
=================================================================
--- trunk/staj-projeleri/migration-tool/migration.py (original)
+++ trunk/staj-projeleri/migration-tool/migration.py Mon Jul 2 17:03:17 2007
@@ -1,19 +1,18 @@
-#!/usr/bin/python
+# -*- coding: utf-8 -*-
-import partition
-import modules
+import sys
-# Search partitions and find users:
-users = [] # user1 = (partition, type, username, userdir)
-partitions = partition.getPartitions()
-for part in partitions:
- if partition.isWindowsPart(part):
- users.extend(partition.getWindowsUsers(part))
+from qt import *
-# List users
-for no,user in enumerate(users):
- print no, user
-no = input("Choose an operating system and user:")
+from wizard import Wizard
-partition, parttype, username, userdir = users[no]
-myMigration = modules.UserMigration(partition, parttype, userdir)
\ No newline at end of file
+def main():
+ app = QApplication(sys.argv)
+ wizard = Wizard()
+
+ app.setMainWidget(wizard)
+ wizard.show()
+ app.exec_loop()
+
+if __name__ == "__main__":
+ main()
Modified: trunk/staj-projeleri/migration-tool/modules.py
=================================================================
--- trunk/staj-projeleri/migration-tool/modules.py (original)
+++ trunk/staj-projeleri/migration-tool/modules.py Mon Jul 2 17:03:17 2007
@@ -13,25 +13,10 @@
self.destinations = {}
self.options = {"Bookmarks":"true", "IEBookmarks":"true", "FFBookmarks":"true"}
- # Desteklenen programlarin yuklu olup olmadigina bak, yukluyse hangi dizinde olduklarini bul.
- # "Masaustu", "Belgelerim", "Muziklerim" gibi dizinleri bul. Boyutlarini kaydet.
- # Hangi sistem ayarlarinin yapilabildigine bak.
- # Tum bulduklarini "sources" sozlugune kaydet
-
# Collect Information:
- print "\nCollecting Information..."
if parttype in ["Windows Vista", "Windows XP"]:
self.collectWindowsInformation()
self.collectLocalInformation()
-
- # List sources:
- for field, value in self.sources.iteritems():
- print field, "\t", value
-
- widget = OptionsWidget(self.sources, self.options)
-
- print "\nApplying Changes..."
- self.Apply()
def collectWindowsInformation(self):
# Find user directories using registry:
@@ -95,16 +80,16 @@
print "WARNING: Mozilla profile cannot be detected!"
return ""
- def Apply(self):
+ def migrate(self):
# Copy Bookmarks:
if self.options.has_key("Bookmarks") and self.options["Bookmarks"]:
bm = Bookmark()
# Load IE Bookmarks:
- if self.options.has_key("IEBookmarks") and self.options["IEBookmarks"]:
+ if self.options.has_key("IEBookmarks") and self.options["IEBookmarks"] and self.sources.has_key("Favorites Path"):
bm.getIEBookmarks(self.sources["Favorites Path"])
print "Internet Explorer bookmarks loaded."
# Load FF Bookmarks:
- if self.options.has_key("FFBookmarks") and self.options["FFBookmarks"]:
+ if self.options.has_key("FFBookmarks") and self.options["FFBookmarks"] and self.sources.has_key("Firefox Profile Path"):
possiblefile = os.path.join(self.sources["Firefox Profile Path"], "bookmarks.html")
if os.path.isfile(possiblefile):
bm.getFFBookmarks(possiblefile)
@@ -121,10 +106,3 @@
print "WARNING: Firefox bookmarks file cannot be found."
else:
print "WARNING: Firefox is in use. Bookmarks cannot be saved."
-
-
-class OptionsWidget:
- def __init__(self, sources, options):
- # sources'ta bulunan secenekleri soran bir widget goster
- # Bu widget'i kullarak aldigin cevaplari "options" sozlugune kaydet
- pass
Modified: trunk/staj-projeleri/migration-tool/partition.py
=================================================================
--- trunk/staj-projeleri/migration-tool/partition.py (original)
+++ trunk/staj-projeleri/migration-tool/partition.py Mon Jul 2 17:03:17 2007
@@ -56,4 +56,13 @@
except: # hata durumunda bir seyler yap
raise
- return users
\ No newline at end of file
+ return users
+
+def allUsers():
+ "Search partitions and find users"
+ users = [] # user1 = (partition, parttype, username, userdir)
+ partitions = getPartitions()
+ for part in partitions:
+ if isWindowsPart(part):
+ users.extend(getWindowsUsers(part))
+ return users
Uludag-commits mesaj listesiyle ilgili
daha fazla bilgi