Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
I
inary
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
1
Konular (issue)
1
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
SulinOS
inary
Commits
b18c2e5e
Kaydet (Commit)
b18c2e5e
authored
Eki 10, 2005
tarafından
Eray Özkural
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
* fixx0r #570: do not store destdir option as relative path
* short option -N for --no-color
üst
9a18e4bf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
commands.py
pisi/cli/commands.py
+14
-2
config.py
pisi/config.py
+6
-2
No files found.
pisi/cli/commands.py
Dosyayı görüntüle @
b18c2e5e
...
...
@@ -64,7 +64,7 @@ class Command(object):
(
self
.
options
,
self
.
args
)
=
self
.
parser
.
parse_args
()
self
.
args
.
pop
(
0
)
# exclude command arg
self
.
check_auth_info
()
self
.
process_opts
()
def
commonopts
(
self
):
'''common options'''
...
...
@@ -85,7 +85,7 @@ class Command(object):
p
.
add_option
(
"-n"
,
"--dry-run"
,
action
=
"store_true"
,
default
=
False
,
help
=
_
(
"do not perform any action, just show what
\
would be done"
))
p
.
add_option
(
""
,
"--no-color"
,
action
=
"store_true"
,
default
=
False
,
p
.
add_option
(
"
-N
"
,
"--no-color"
,
action
=
"store_true"
,
default
=
False
,
help
=
_
(
"print like a man"
))
return
p
...
...
@@ -94,6 +94,18 @@ class Command(object):
options function it will be called"""
pass
def
process_opts
(
self
):
self
.
check_auth_info
()
# make destdir absolute
if
self
.
options
.
destdir
:
dir
=
str
(
self
.
options
.
destdir
)
import
os.path
if
not
os
.
path
.
exists
(
dir
):
raise
Exception
,
_
(
'Destination directory
%
s does not exist'
)
%
dir
self
.
options
.
destdir
=
os
.
path
.
realpath
(
dir
)
def
check_auth_info
(
self
):
username
=
self
.
options
.
username
password
=
self
.
options
.
password
...
...
pisi/config.py
Dosyayı görüntüle @
b18c2e5e
...
...
@@ -47,9 +47,13 @@ class Config(object):
def
dest_dir
(
self
):
dir
=
self
.
get_option
(
'destdir'
)
if
dir
:
return
str
(
dir
)
dir
=
str
(
dir
)
else
:
return
self
.
values
.
general
.
destinationdirectory
dir
=
self
.
values
.
general
.
destinationdirectory
import
os.path
if
not
os
.
path
.
exists
(
dir
):
raise
Exception
,
_
(
'Destination directory
%
s does not exist'
)
%
dir
return
dir
def
lib_dir
(
self
):
return
join
(
self
.
dest_dir
(),
self
.
values
.
dirs
.
lib_dir
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment