Ejemplo n.º 1
0
 def insertInput(self, index):
     url = askstring('New Mod at Index ' + str(index + 1),
                     'Input Nexus URL')
     info = None
     if (url is not None):
         info = ParseURL.parse_nexus_url(url)
     if info is not None:
         self.insert(index, info)
Ejemplo n.º 2
0
 def add_entry(self):
     '''adds a valid Nexus URL's mod data into the list'''
     url = self.url_entry.get()
     info = ParseURL.parse_nexus_url(url)
     #insert mod if parsed properly
     if info is not None:
         self.modlistbox.modlists[len(self.modlistbox.modlists) - 1].insert(
             END, info)
         #clear text after completion
         self.url_entry.delete(0, 'end')
Ejemplo n.º 3
0
 def insert(self, info_list):
     text = self.text.get('1.0', END)
     urls = text.splitlines()
     urls[:] = [x for x in urls if x != '']
     #Makes sure Nexus mods are correctly stripped
     for i in range(len(urls)):
         urls[i] = self.strip_nexus_mod(urls[i])
     infos = []
     if self.nexus:
         #Adds the information of only Nexus mods to the list
         for url in urls:
             info = ParseURL.parse_nexus_url(url, warning=False)
             if info is not None:
                 info_list.append(info)
     else:
         #Adds all the obtained urls to the list
         info_list += urls
     #Remove duplicates from the list
     info_list[:] = self.remove_dupes(info_list)
     if len(info_list) == 0:
         info_list.append(False)
     self.destroy()