Talk:Migrate aNd Manage

From CDOT Wiki
Revision as of 11:19, 14 October 2008 by Bossa nesta (talk | contribs)
Jump to: navigation, search
  1. !/usr/bin/env python


  1. a sample python script for Windows Data Migration Tool
  1. just to make sure the concepts works in python...


                    1. Program Logic Flow v0.1 20081012 ##########
  1. - Show welcome page and descriptions
  1. - Search Windows User Folders
  1. - Gethering folders information
  1. - Check if Fedora User parition is enough for all documents from Windows users
  1. - Prompt if administrator wants every thing automatic -> go to AUTO else -> go to MANUAL
  1. AUTO
  1. - List all possible users and ask if every thing is correct
  1. - Ask for dummy password for each user
  1. - Automatic create User
  1. - Automatic move User documents to each user directory
  1. - Automatic migrate bookmarks to Konqueror
  1. MANUAL
  1. - List all possible users and ask for individual password
  1. - Prompt each folder that copy to Fedora partition, and see if administrator wants to move files to a specific folder
  1. - Prompt each user when move bookmarks to Konqueror
  1. -


import os, os.path, shutil


print "============================================================"

print " Windows Data Migration Tool"

print " Function Test"

print "============================================================"



PATH="/tmp/test"

print "check if directory ", PATH ,"exist"

print os.path.isdir(PATH)



PATH2=PATH+"2"


print "check if ", PATH, "and ", PATH2, "exist"

print PATH, os.path.isdir(PATH)

print PATH, os.path.isdir(PATH2)


print "creat folder", PATH, ",if it's not exist"

if not os.access(PATH, os.F_OK):

   os.mkdir(PATH)


  1. print os.listdir("/tmp")

if not os.access(PATH2, os.F_OK):

       shutil.copytree(PATH,PATH2)

else:

       print PATH2, "alredy exist. dir not copyied"


  1. shutil.rmtree(PATH2)