Fatih Aşıcı yazdı 03-11-2011 09:09 tarihinde:
> Exception olarak kalabilir. Emin olamadım.

Ok. Aynı modülün get_repo_by_url metodunda 'return None' tercih edilmiş
bu arada.

> 
>> Index: pisi/db/repodb.py
>> ===================================================================
>> --- pisi/db/repodb.py    (revision 38426)
>> +++ pisi/db/repodb.py    (working copy)
>> @@ -151,6 +151,9 @@
>>           return url in self.list_repo_urls(only_active)
>>
>>       def get_repo_doc(self, repo_name):
>> +        if not self.has_repo(repo_name):
>> +            raise RepoError(_('Repository %s does not exist. Cannot
>> get repo doc.' % repo))
> 
> repo değişkenini _() parantezinin dışına almalısın.

İkisinde de değiştirip, parantezin dışına aldım.

-- 
Metin Akdere
Index: pisi/db/repodb.py
===================================================================
--- pisi/db/repodb.py	(revision 38426)
+++ pisi/db/repodb.py	(working copy)
@@ -151,6 +151,9 @@
         return url in self.list_repo_urls(only_active)
 
     def get_repo_doc(self, repo_name):
+        if not self.has_repo(repo_name):
+            raise RepoError(_("Repository %s does not exist. Cannot get repo doc.") % repo)
+
         repo = self.get_repo(repo_name)
 
         index_path = repo.indexuri.get_uri()
@@ -178,6 +181,9 @@
 
     #FIXME: this method is a quick hack around repo_info.indexuri.get_uri()
     def get_repo_url(self, repo):
+        if not self.has_repo(repo):
+            raise RepoError(_("Repository %s does not exist. Cannot get repo URL.") % repo)
+
         urifile_path = pisi.util.join_path(ctx.config.index_dir(), repo, "uri")
         uri = open(urifile_path, "r").read()
         return uri.rstrip()

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Gelistirici mailing list
Gelistirici@pardus.org.tr
http://liste.pardus.org.tr/mailman/listinfo/gelistirici

Cevap