Ejemplo n.º 1
0
 def add_apt_sources(self, opts, args):
     arch = opts.arch
     filename = None
     if args:
         filename = args[0]
     if filename is None:
         filename = use_stdin_instead_of_filename()
     sources_to_config(filename=filename, arch=arch,
                       config=self.config, output='')
     # write config
     self.config.write_file()
Ejemplo n.º 2
0
 def add_apt_sources(self, opts, args):
     arch = opts.arch
     filename = None
     if args:
         filename = args[0]
     if filename is None:
         filename = use_stdin_instead_of_filename()
     sources_to_config(filename=filename,
                       arch=arch,
                       config=self.config,
                       output='')
     # write config
     self.config.write_file()
Ejemplo n.º 3
0
 def add_filterlist(self, opts, args):
     sections = self._determine_sections(opts)
     filename = None
     if len(args) != 1:
         raise ImproperArgumentsError , "Need a name/filename argument"
     arg = path(args[0])
     if not arg.isfile():
         name = arg
         filename = use_stdin_instead_of_filename()
     else:
         name = arg.basename()
         filename = arg
     flist = self.flmanager.make_filterlist(name, filename=filename)
     self.flmanager.write_filterlist_to_confdirs(flist, sections)
     for section in sections:
         self.flmanager.add_filterlist_to_section(section, flist)
Ejemplo n.º 4
0
 def add_filterlist(self, opts, args):
     sections = self._determine_sections(opts)
     filename = None
     if len(args) != 1:
         raise ImproperArgumentsError, "Need a name/filename argument"
     arg = path(args[0])
     if not arg.isfile():
         name = arg
         filename = use_stdin_instead_of_filename()
     else:
         name = arg.basename()
         filename = arg
     flist = self.flmanager.make_filterlist(name, filename=filename)
     self.flmanager.write_filterlist_to_confdirs(flist, sections)
     for section in sections:
         self.flmanager.add_filterlist_to_section(section, flist)