3
# gets a list of samba shares on the selected host
7
from os import system, environ, path, getenv, mkdir, getcwd
10
# check if ~/.pyNeighborhood exists. If not, create it
11
if not path.exists(getenv("HOME")+"/.pyNeighborhood"):
12
mkdir(getenv("HOME")+"/.pyNeighborhood")
14
if path.exists(getenv("HOME")+"/.pyNeighborhood"):
16
hostslocation = string.join([home, "/.pyNeighborhood"], '')
17
os.chdir(hostslocation)
20
#check if file containing a list of favourite hosts exists. If not, create it
21
hostfile = open('hosts', 'a')
24
#read hosts from file and create a standart list of them
25
hostfile = open("hosts", 'r')
27
list = hostfile.readlines()
33
hostline = line.split("\n")
34
hostlist.append(hostline[0])