Kaydet (Commit) 0c3fe2a7 authored tarafından Suleyman Poyraz's avatar Suleyman Poyraz

Search-File komutu fixe edildi. Biraz renk verirsek inary'nin tamamına bütün işimiz bitmiş olacak

üst e6179182
......@@ -17,11 +17,8 @@
Şu satır bir kontrol edilmeli:
2018-03-17 Suleyman POYRAZ <nipalensisaquila@gmail.com>
* inary searchfile command: --- status: not fixed; flag: critical ---:
Traceback:
Program terminated.
You have to be root for this operation.
Please use 'inary help' for general help.
* inary searchfile command: --- status: fixed; flag: critical ---:
-> filesdb modulune dayalı bir hata tespit edildi.
2018-01-26 Suleyman POYRAZ <nipalensisaquila@gmail.com>
......@@ -36,6 +33,7 @@
* inary/sxml/xmlext --- status: fixed; flag: cosmetical ---:
-> Minidom kullanarak fixe edildi
-> Ciksemel için gzip modulu kullanımındaki hata fixe edildi.
xmlext modulunde bulunan getNodeText olayinda ciktilar utf-8 ile
decode edilmeli. Yoksa Localtext ve Text type veriler ile ilgili sorun
cıkıyor
......
......@@ -44,17 +44,17 @@ Finds the installed package which contains the specified file.
def search_file(self, path):
found = search.search_file(path)
for pkg, files in found:
for pkg_file in files:
ctx.ui.info(_("Package {0} has file /{1}").format(pkg, pkg_file))
if not found:
ctx.ui.error(_("Path '{}' does not belong to an installed package").format(path))
for pkg, files in found:
for pkg_file in files:
ctx.ui.info(_("Package {0} has file /{1}").format(pkg, pkg_file))
def run(self):
self.init(database = True, write = False)
print(34623456)
if not self.args:
self.help()
......
......@@ -38,10 +38,6 @@ class FilesDB(lazydb.LazyDB):
def __del__(self):
self.close()
def has_file(self, path):
if key in self.filesdb:
return True
def create_filesdb(self):
ctx.ui.info(inary.util.colorize(_('Creating files database...'), 'blue'))
installdb = inary.db.installdb.InstallDB()
......@@ -55,8 +51,8 @@ class FilesDB(lazydb.LazyDB):
return self.filesdb.get(key), path
def search_file(self, term):
if self.has_file(term):
pkg, path = self.get_file(term)
pkg, path = self.get_file(term)
if pkg:
return [(pkg,[path])]
installdb = inary.db.installdb.InstallDB()
......
......@@ -74,5 +74,5 @@ def search_file(term):
"""
if term.startswith("/"): # FIXME: why? why?
term = term[1:]
return ctx.filesdb.search_file(term)
return ctx.filesdb.search_file(term)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment