|
@@ -107,6 +107,7 @@ class EntryWindow(Gtk.Window):
|
|
|
|
|
|
|
|
#Creating the TreeStore model
|
|
#Creating the TreeStore model
|
|
|
self.vhost_treestore = Gtk.TreeStore(int, str, str)
|
|
self.vhost_treestore = Gtk.TreeStore(int, str, str)
|
|
|
|
|
+ self.parents = {}
|
|
|
|
|
|
|
|
vhost_list = []
|
|
vhost_list = []
|
|
|
# for vhost in vhost_list:
|
|
# for vhost in vhost_list:
|
|
@@ -116,7 +117,7 @@ class EntryWindow(Gtk.Window):
|
|
|
|
|
|
|
|
#creating the treeview, making it use the filter as a model, and adding the columns
|
|
#creating the treeview, making it use the filter as a model, and adding the columns
|
|
|
self.treeview = Gtk.TreeView.new_with_model(self.language_filter)
|
|
self.treeview = Gtk.TreeView.new_with_model(self.language_filter)
|
|
|
- for i, column_title in enumerate(["Port", "File path", "Root domain"]):
|
|
|
|
|
|
|
+ for i, column_title in enumerate(["Port", "Domain", "File path"]):
|
|
|
renderer = Gtk.CellRendererText()
|
|
renderer = Gtk.CellRendererText()
|
|
|
column = Gtk.TreeViewColumn(column_title, renderer, text=i)
|
|
column = Gtk.TreeViewColumn(column_title, renderer, text=i)
|
|
|
self.treeview.append_column(column)
|
|
self.treeview.append_column(column)
|
|
@@ -207,7 +208,6 @@ class EntryWindow(Gtk.Window):
|
|
|
subd_trimmed = directive[1].strip()
|
|
subd_trimmed = directive[1].strip()
|
|
|
subdomains = subd_trimmed.split(' ')
|
|
subdomains = subd_trimmed.split(' ')
|
|
|
port_subdmomains[port] = subdomains
|
|
port_subdmomains[port] = subdomains
|
|
|
- parents = {}
|
|
|
|
|
for subd in subdomains:
|
|
for subd in subdomains:
|
|
|
# subdomain = '*' + subd if is_domain_root(subd) else subd
|
|
# subdomain = '*' + subd if is_domain_root(subd) else subd
|
|
|
# print(subdomain)
|
|
# print(subdomain)
|
|
@@ -217,11 +217,11 @@ class EntryWindow(Gtk.Window):
|
|
|
if not is_valid_domain(subd):
|
|
if not is_valid_domain(subd):
|
|
|
raise InvalidDomainError(subd)
|
|
raise InvalidDomainError(subd)
|
|
|
|
|
|
|
|
- if not root in parents.keys():
|
|
|
|
|
- parents[root] = self.vhost_treestore.append(None, (port, vhost, subd))
|
|
|
|
|
|
|
+ if not root in self.parents.keys():
|
|
|
|
|
+ self.parents[root] = self.vhost_treestore.append(None, (port, root, vhost))
|
|
|
if root != subd:
|
|
if root != subd:
|
|
|
- parent = parents[root]
|
|
|
|
|
- self.vhost_treestore.append(parent, (port, '', subd))
|
|
|
|
|
|
|
+ parent = self.parents[root]
|
|
|
|
|
+ self.vhost_treestore.append(parent, (port, subd, vhost))
|
|
|
# print(parents)
|
|
# print(parents)
|
|
|
|
|
|
|
|
|
|
|