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
273109fd
Kaydet (Commit)
273109fd
authored
Ara 23, 2019
tarafından
Suleyman Poyraz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge remote-tracking branch 'gitlab_mirror/fix-fetcher' into develop
üst
78e42237
e5043840
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
16 deletions
+35
-16
__init__.py
inary/cli/__init__.py
+23
-9
addrepo.py
inary/cli/addrepo.py
+1
-1
repodb.py
inary/db/repodb.py
+1
-1
file.py
inary/file.py
+5
-3
install.py
inary/operations/install.py
+2
-1
package.py
inary/package.py
+2
-0
ui.py
inary/ui.py
+1
-1
No files found.
inary/cli/__init__.py
Dosyayı görüntüle @
273109fd
...
...
@@ -56,6 +56,7 @@ class CLI(inary.ui.UI):
super
(
CLI
,
self
)
.
__init__
(
show_debug
,
show_verbose
)
self
.
warnings
=
0
self
.
errors
=
0
self
.
clean_line
=
"
\x1b
[K"
def
close
(
self
):
util
.
xterm_title_reset
()
...
...
@@ -67,6 +68,7 @@ class CLI(inary.ui.UI):
if
err
:
sys
.
stderr
.
write
(
str
(
msg
))
else
:
msg
=
self
.
clean_line
+
msg
+
self
.
clean_line
sys
.
stdout
.
write
(
str
(
msg
))
def
formatted_output
(
self
,
msg
,
verbose
=
False
,
noln
=
False
,
column
=
":"
):
...
...
@@ -180,9 +182,9 @@ class CLI(inary.ui.UI):
if
no_expr
.
search
(
s
):
return
False
def
display_progress
(
self
,
**
ka
):
""" display progress of any operation """
if
ka
[
'operation'
]
in
[
"removing"
,
"rebuilding-db"
]:
return
...
...
@@ -190,14 +192,13 @@ class CLI(inary.ui.UI):
if
not
ctx
.
get_option
(
"no_color"
):
complated_background
=
'backgroundgreen'
queried_background
=
'backgroundyellow'
complated
=
'brightblue'
else
:
complated_background
=
queried_background
=
complated
=
"default"
hr_size
,
hr_symbol
=
util
.
human_readable_size
(
ka
[
"total_size"
])
totalsize
=
'{:.1f} {}'
.
format
(
hr_size
,
hr_symbol
)
file_and_totalsize
=
'{:30.
5
0} ({})'
.
format
(
ka
[
'filename'
],
totalsize
)
file_and_totalsize
=
'{:30.
2
0} ({})'
.
format
(
ka
[
'filename'
],
totalsize
)
percentage_and_time
=
'{:9.2f}
%
{:9.2f} {} [ {} ]'
.
format
(
ka
[
'percent'
],
ka
[
'rate'
],
ka
[
'symbol'
],
...
...
@@ -214,12 +215,9 @@ class CLI(inary.ui.UI):
self
.
output
(
out
)
lmsg
=
int
(
(
len
(
msg
)
*
ka
[
"percent"
]
)
/
100
)
+
1
if
ka
[
"percent"
]
==
100
:
self
.
output
(
"
\r
"
+
ctx
.
const
.
colors
[
complated
]
+
msg
+
ctx
.
const
.
colors
[
'default'
])
else
:
self
.
output
(
"
\r
"
+
ctx
.
const
.
colors
[
complated_background
]
+
\
msg
[:
lmsg
]
+
ctx
.
const
.
colors
[
queried_background
]
+
msg
[
lmsg
:]
+
\
ctx
.
const
.
colors
[
'default'
])
self
.
output
(
"
\r
"
.
format
(
lmsg
)
+
ctx
.
const
.
colors
[
complated_background
]
+
\
msg
[:
lmsg
]
+
ctx
.
const
.
colors
[
queried_background
]
+
msg
[
lmsg
:]
+
\
ctx
.
const
.
colors
[
'default'
])
util
.
xterm_title
(
"{} ( {:.2f}
%
)"
.
format
(
ka
[
'filename'
],
ka
[
'percent'
]))
else
:
...
...
@@ -280,6 +278,22 @@ class CLI(inary.ui.UI):
ctx
.
log
.
info
(
_
(
"Extracted desktop file
\"
{}
\"
"
)
.
format
(
keywords
[
'desktopfile'
]))
msg
=
None
elif
event
==
inary
.
ui
.
fetching
:
if
self
.
show_verbose
:
msg
=
""
else
:
msg
=
"
\x1b
[K"
msg
+=
_
(
"Downloading <{} / {}>"
.
format
(
keywords
[
'which'
],
keywords
[
'total'
]))
color
=
"yellow"
elif
event
==
inary
.
ui
.
fetched
:
if
self
.
show_verbose
:
msg
=
""
else
:
msg
=
"
\x1b
[3A"
msg
+=
_
(
"Downloaded
\"
{}
\"
"
.
format
(
keywords
[
'name'
]))
color
=
"green"
else
:
msg
=
None
...
...
inary/cli/addrepo.py
Dosyayı görüntüle @
273109fd
...
...
@@ -80,7 +80,7 @@ NB: We support only local files (e.g., /a/b/c) and http:// URIs at the moment
try
:
repository
.
update_repos
([
name
])
except
(
inary
.
errors
.
Error
,
IOError
)
as
e
:
ctx
.
ui
.
warning
(
_
(
"{0} repository could not be reached: {1}"
)
.
format
(
name
,
e
)
)
ctx
.
ui
.
info
(
_
(
"Error: {0} repository could not be reached:
\n
{1}"
)
.
format
(
name
,
e
),
color
=
"red"
)
self
.
warn_and_remove
(
_
(
"Removing {0} from system."
)
.
format
(
name
),
name
)
else
:
ctx
.
ui
.
warning
(
_
(
"Couldn't trust
\"
{0}
\"
repository. It is deactivated."
)
.
format
(
name
))
...
...
inary/db/repodb.py
Dosyayı görüntüle @
273109fd
...
...
@@ -171,7 +171,7 @@ class RepoDB(lazydb.LazyDB):
index_path
=
os
.
path
.
splitext
(
index_path
)[
0
]
if
not
os
.
path
.
exists
(
index_path
):
ctx
.
ui
.
warning
(
_
(
"{} repository needs to be updated"
)
.
format
(
repo_name
))
#
ctx.ui.warning(_("{} repository needs to be updated").format(repo_name))
return
xmlext
.
newDocument
(
"INARY"
)
try
:
...
...
inary/file.py
Dosyayı görüntüle @
273109fd
...
...
@@ -143,10 +143,12 @@ class File:
inary
.
fetcher
.
fetch_url
(
uri
,
transfer_dir
,
ctx
.
ui
.
Progress
,
tmpfile
)
else
:
# copy to transfer dir
ctx
.
ui
.
info
(
_
(
"Copying
\"
{}
\"
to transfer dir"
)
.
format
(
uri
.
get_uri
()),
verbose
=
True
)
shutil
.
copy
(
uri
.
get_uri
(),
localfile
)
inary
.
fetcher
.
fetch_from_locale
(
uri
.
get_uri
(),
transfer_dir
,
destfile
=
localfile
)
else
:
localfile
=
uri
.
get_uri
()
# TODO: use a special function here?
if
localfile
.
startswith
(
"file:///"
):
localfile
=
localfile
[
7
:]
if
not
os
.
path
.
exists
(
localfile
):
raise
IOError
(
_
(
"File
\"
{}
\"
not found."
)
.
format
(
localfile
))
if
not
os
.
access
(
localfile
,
os
.
W_OK
):
...
...
@@ -259,7 +261,7 @@ class File:
except
KeyboardInterrupt
:
raise
except
IOError
:
# FIXME: what exception could we catch here, replace with that.
ctx
.
ui
.
error
(
NoSignatureFound
(
uri
))
ctx
.
ui
.
warning
(
NoSignatureFound
(
uri
))
return
True
ret
,
out
,
err
=
inary
.
util
.
run_batch
(
'gpg --verify '
+
sigfilename
)
...
...
inary/operations/install.py
Dosyayı görüntüle @
273109fd
...
...
@@ -94,7 +94,7 @@ def install_pkg_names(A, reinstall=False, extra=False):
paths
=
[]
extra_paths
=
{}
for
x
in
order
:
ctx
.
ui
.
info
(
_
(
"Downloading {} / {}"
)
.
format
(
order
.
index
(
x
)
+
1
,
len
(
order
)),
color
=
"yellow"
)
ctx
.
ui
.
notify
(
ui
.
fetching
,
which
=
order
.
index
(
x
)
+
1
,
total
=
len
(
order
)
)
install_op
=
atomicoperations
.
Install
.
from_name
(
x
)
paths
.
append
(
install_op
.
package_fname
)
if
x
in
extra_packages
or
(
extra
and
x
in
A
):
...
...
@@ -103,6 +103,7 @@ def install_pkg_names(A, reinstall=False, extra=False):
installdb
.
installed_extra
.
remove
(
x
)
with
open
(
os
.
path
.
join
(
ctx
.
config
.
info_dir
(),
ctx
.
const
.
installed_extra
),
"w"
)
as
ie_file
:
ie_file
.
write
(
"
\n
"
.
join
(
installdb
.
installed_extra
)
+
(
"
\n
"
if
installdb
.
installed_extra
else
""
))
ctx
.
ui
.
notify
(
ui
.
fetched
,
name
=
x
)
# fetch to be installed packages but do not install them.
if
ctx
.
get_option
(
'fetch_only'
):
...
...
inary/package.py
Dosyayı görüntüle @
273109fd
...
...
@@ -66,6 +66,8 @@ class Package:
if
url
.
is_remote_file
():
self
.
fetch_remote_file
(
url
)
else
:
ctx
.
ui
.
info
(
_
(
"Getting package file
\"
{}
\"
from locale."
)
.
format
(
url
.
filename
()))
try
:
self
.
impl
=
archive
.
ArchiveZip
(
self
.
filepath
,
'zip'
,
mode
)
...
...
inary/ui.py
Dosyayı görüntüle @
273109fd
...
...
@@ -15,7 +15,7 @@
#
(
installed
,
upgraded
,
removed
,
installing
,
removing
,
configuring
,
configured
,
extracting
,
downloading
,
packagestogo
,
updatingrepo
,
cached
,
desktopfile
)
=
list
(
range
(
13
))
downloading
,
packagestogo
,
updatingrepo
,
cached
,
desktopfile
,
fetching
,
fetched
)
=
list
(
range
(
15
))
class
UI
(
object
):
...
...
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