[Gelistirici] [Fwd: trunk/pisi/pisi - Add new option to pisi ar : --ignore-check]

Serdar Dalgic serdar at pardus.org.tr
14 Ara 2009 Pzt 14:59:14 EET


2009/12/14 Ozan Çağlayan <ozan at pardus.org.tr>

> Bir kaç bişey:
>
>
> Modified: trunk/pisi/pisi/cli/addrepo.py
> =================================================================
> --- trunk/pisi/pisi/cli/addrepo.py      (original)
> +++ trunk/pisi/pisi/cli/addrepo.py      Mon Dec 14 13:55:00 2009
> @@ -45,6 +45,9 @@
>         group.add_option("--at", action="store",
>                                type="int", default=None,
>                                help=_("Add repository at given position (0
> is first)"))
> +        group.add_option("--ignore-check", action="store_true",
> +                               default=False,
> +                               help=_("Ignore distribution release and
> architecture checks"))
>         self.parser.add_option_group(group)
>
> ######## "Skip distribution release and architecture check" daha düzgün
> bence.
>
>
hmm, skip daha iyi evet, değiştiriyorum.


>
>     def run(self):
>
> Modified: trunk/pisi/pisi/index.py
> =================================================================
> --- trunk/pisi/pisi/index.py    (original)
> +++ trunk/pisi/pisi/index.py    Mon Dec 14 13:55:00 2009
> @@ -34,6 +34,16 @@
>  class Error(pisi.Error):
>     pass
>
> +class NotCompatibleDistroException(pisi.Exception):
> +    def __init__(self, repoVersion, curDistro, curDistVersion):
> +        pisi.Exception.__init__(self, "Opps, sorry, this repository for %s
> is not compatible with your distribution release %s %s." \
> +                % (repoVersion, curDistro, curDistVersion))
> +
> +class NotCompatibleArchException(pisi.Exception):
> +    def __init__(self, repoArch, curArch):
> +        pisi.Exception.__init__(self, "Opps, sorry, repo architecture %s
> is not compatible with your %s architecture." \
> +                % (repoArch, curArch))
>
>
> ##### Exception isimleri şöyle olsa?
> DistributionMismatchException
> ArchitectureMismatchException
>
> distro ve arch gibi kısaltmaya gerek yok bence.
>
> ###### Bir de Exception mesajlarında oops'a sorry'ye falan gerek yok bence:
> The repository couldn't be added because of distribution release mismatch.
> The repository couldn't ve added because of distribution architecture
> mismatch.
>
>
Exception'ları ctx.ui.error ile bastırmak daha mantıklı sanırım, hem
çevrilebilir olacaklar, hem de pisi.Exception class'ı yaratmadan handle
edilebilecekler. Bu şekilde değiştiriyorum.


>
> check_distribution_and_architecture() şeklinde uzun olarak yazarsak daha
> düzgün bence.
>
>
fonksiyonun adını da bu şekilde dğeiştirdim.


> config nesnesi zaten o esnada bir yerde olabilir (büyük ihtimalle hatta).
> tekrar yaratman gerekmeyebilir.
> # First check if architecture tag....
>
> yorumu da ikinci if'in üstüne gelmeli.
>

bu da tamam.

-- 
- Serdar Dalgic
-------------- sonraki bölüm --------------
Bir HTML eklentisi temizlendi...
URL: <http://liste.pardus.org.tr/gelistirici/attachments/20091214/f6bb9940/attachment-0002.htm>


Gelistirici mesaj listesiyle ilgili daha fazla bilgi