1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
| def Nautilus(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE):
print ("Nautilus")
GESTIONAIRE_FICHIERS = "nautilus"
cmd = GESTIONAIRE_FICHIERS+" sftp://"+USER_MACHINE+":"+MDP+"@"+IP_MACHINE+" :"+PORT_MACHINE+" "+DOSSIER_MACHINE # AVEC MDP
#cmd = PROG+USER_MACHINE+":"+MDP+"@"+IP_MACHINE+":"+PORT_MACHINE+""+DOSSIER_MACHINE
print cmd
os.system(cmd)
def Dolphin(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE):
GESTIONAIRE_FICHIERS = "dolphin"
cmd = GESTIONAIRE_FICHIERS+" sftp://"+USER_MACHINE+":"+MDP+"@"+IP_MACHINE+":"+PORT_MACHINE+""+DOSSIER_MACHINE # AVEC MDP
#cmd = PROG+USER_MACHINE+":"+MDP+"@"+IP_MACHINE+":"+PORT_MACHINE+""+DOSSIER_MACHINE
print cmd
os.system(cmd)
def Thunar(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE):
None
def Pcmanfm(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE):
None
def Konqueror(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE):
GESTIONAIRE_FICHIERS = "konqueror"
cmd = GESTIONAIRE_FICHIERS+" sftp://"+USER_MACHINE+":"+MDP+"@"+IP_MACHINE+":"+PORT_MACHINE+""+DOSSIER_MACHINE # AVEC MDP
#cmd = PROG+USER_MACHINE+":"+MDP+"@"+IP_MACHINE+":"+PORT_MACHINE+""+DOSSIER_MACHINE
print cmd
os.system(cmd)
def Caja(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE):
None
def Peony(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE):
None
def Nemo(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE):
None
def Spacefm(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE):
None
def Ssh(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE):
PROG = "ssh "
#cmd2 = GESTIONAIRE_FICHIERS+" sftp://"+USER_MACHINE+":"+MDP+"@"+IP_MACHINE+" :"+PORT_MACHINE+""+DOSSIER_MACHINE # AVEC MDP
cmd = PROG+USER_MACHINE+"@"+IP_MACHINE+" -p "+PORT_MACHINE
print cmd
os.system(cmd)
def Sshpro(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE):
PROG = "sshpro "
#cmd2 = GESTIONAIRE_FICHIERS+" sftp://"+USER_MACHINE+":"+MDP+"@"+IP_MACHINE+" :"+PORT_MACHINE+""+DOSSIER_MACHINE # AVEC MDP
cmd = PROG+USER_MACHINE+":"+MDP+"@"+IP_MACHINE+":"+PORT_MACHINE+""+DOSSIER_MACHINE
print cmd
os.system(cmd)
def Choix(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE):
#global USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE, NOM_MACHINE, INFO_MACHINE
PADY_LABEL = "1"
PADY_BT = "1"
filewin = Toplevel(master)
Frame1 = Frame(filewin, borderwidth=1, relief=GROOVE)
Frame1.pack(side=TOP, padx=1, pady=1)
Label(Frame1, text="Information et type de connexion", bg=FBG, fg=FFG, font=FFT, bd=FBD, relief=FRF).pack(padx=5, pady=5)
#Label(Frame1, text="INFO MACHINE : "+INFO_MACHINE_1, bg=FBG, fg=FFG, font=FFT, bd=FBD, relief=FRF).pack(padx=4, pady=4)
#Label(Frame1, text="INFO MACHINE : "+ "I7 960", bg="silver", fg="black", font="Arial 10", bd="4", relief="flat").pack(padx=1, pady=1)
# LabelFrame 1 - 1
Frame1_Label1 = Frame(Frame1, width=380, height=310) # 280 / 200 - Largeur / Hauteur
Frame1_Label1.pack(side=TOP, padx=5, pady=1)
xFrame1_Label1 = Frame(Frame1_Label1, relief=GROOVE, borderwidth=2)
Label(xFrame1_Label1, text="").pack(pady=PADY_LABEL)
#Button(xFrame1_Label1, text=" IP locale ", command=lambda :IP_LOCAL(0, 1)).pack(side=TOP, padx=1, pady=1)
#Button(xFrame1_Label1, text="IP internet", command=cmd_iframe1_2_ip2).pack(side=TOP, padx=1, pady=1)
Label(xFrame1_Label1, text="Machine : "+NOM_MACHINE).pack(pady=PADY_LABEL)
Label(xFrame1_Label1, text="Info : "+INFO_MACHINE).pack(pady=PADY_LABEL)
Label(xFrame1_Label1, text="Login : "+USER_MACHINE).pack(pady=PADY_LABEL)
Label(xFrame1_Label1, text="Mot de passe : "+MDP).pack(pady=PADY_LABEL)
Label(xFrame1_Label1, text="Adresse IP : "+IP_MACHINE).pack(pady=PADY_LABEL)
Label(xFrame1_Label1, text="Port machine : "+PORT_MACHINE).pack(pady=PADY_LABEL)
Label(xFrame1_Label1, text="Dossier machine : "+DOSSIER_MACHINE).pack(pady=PADY_LABEL)
Label(xFrame1_Label1, text="").pack(pady=PADY_LABEL)
xFrame1_Label1.place(relx=0.01, rely=0.125, anchor=NW)
Label(Frame1_Label1, text="Information ").place(relx=.06, rely=0.125,anchor=W)
Frame1_Label1.pack()
# LabelFrame 1 - 2
Frame1_Label2 = Frame(Frame1, width=480, height=540) # Largeur / Hauteur
Frame1_Label2.pack(side=TOP, padx=5, pady=5)
xFrame1_Label2 = Frame(Frame1_Label2, relief=GROOVE, borderwidth=2)
Label(xFrame1_Label2, text="").pack(pady=5)
#Button(xFrame1_Label1, text=" IP locale ", command=lambda :IP_LOCAL(0, 1)).pack(side=TOP, padx=1, pady=1)
#Button(xFrame1_Label1, text="IP internet", command=cmd_iframe1_2_ip2).pack(side=TOP, padx=1, pady=1)
Button(xFrame1_Label2, text="Ubuntu / Gnome / Gestionnaire de fichiers : Nautilus", command=lambda :Nautilus(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE), relief=FLAT).pack(side=TOP, padx=1, pady=PADY_BT)
Button(xFrame1_Label2, text="Kubuntu / KDE / Gestionnaire de fichiers : Dolphin", command=lambda :Dolphin(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE), relief=FLAT).pack(side=TOP, padx=1, pady=PADY_BT)
Button(xFrame1_Label2, text="Xubuntu / XFCE / Gestionnaire de fichiers : Thunar", command=lambda :Thunar(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE), relief=FLAT).pack(side=TOP, padx=1, pady=PADY_BT)
Button(xFrame1_Label2, text="Lubuntu / LXCE / Gestionnaire de fichiers : PCManFM", command=lambda :Pcmanfm(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE), relief=FLAT).pack(side=TOP, padx=1, pady=PADY_BT)
Button(xFrame1_Label2, text="", command=None, relief=FLAT).pack(side=TOP, padx=1, pady=PADY_BT)
Button(xFrame1_Label2, text="Autre / KDE / Gestionnaire de fichiers : Konqueror", command=lambda :Konqueror(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE), relief=FLAT).pack(side=TOP, padx=1, pady=PADY_BT)
Button(xFrame1_Label2, text="Autre / Ubuntu Mate / Gestionnaire de fichiers : Caja", command=lambda :Caja(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE), relief=FLAT).pack(side=TOP, padx=1, pady=PADY_BT)
Button(xFrame1_Label2, text="Autre / Ukui / Gestionnaire de fichiers : Peony", command=lambda :Peony(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE), relief=FLAT).pack(side=TOP, padx=1, pady=PADY_BT)
Button(xFrame1_Label2, text="Autre / Cinnamon / Gestionnaire de fichiers : Nemo", command=lambda :Nemo(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE), relief=FLAT).pack(side=TOP, padx=1, pady=PADY_BT)
Button(xFrame1_Label2, text="Autre / fork de PCMan File Manager / Gestionnaire de fichiers : SpaceFM", command=lambda :Spacefm(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE), relief=FLAT).pack(side=TOP, padx=1, pady=PADY_BT)
Button(xFrame1_Label2, text="", command=None, relief=FLAT).pack(side=TOP, padx=1, pady=PADY_BT)
Button(xFrame1_Label2, text="SSH", command=lambda :Ssh(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE), relief=FLAT).pack(side=TOP, padx=1, pady=PADY_BT)
Button(xFrame1_Label2, text="SSHPRO", command=lambda :Sshpro(NOM_MACHINE, INFO_MACHINE, USER_MACHINE, MDP, IP_MACHINE, PORT_MACHINE, DOSSIER_MACHINE), relief=FLAT).pack(side=TOP, padx=1, pady=PADY_BT)
Button(xFrame1_Label2, text="", command=None, relief=FLAT).pack(side=TOP, padx=1, pady=PADY_BT)
xFrame1_Label2.place(relx=0.01, rely=0.125, anchor=NW)
Label(Frame1_Label2, text="Cliquez sur un choix ").place(relx=.06, rely=0.125,anchor=W)
Frame1_Label2.pack()
Label(filewin, text="").pack(pady=PADY_LABEL)
Button(filewin, text="Annuler", command=filewin.destroy).pack(side=TOP, padx=1, pady=1)
Label(filewin, text="").pack(pady=PADY_LABEL)
filewin.mainloop() |
Partager