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)
0
Konular (issue)
0
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
a70226fb
Kaydet (Commit)
a70226fb
authored
Tem 05, 2019
tarafından
Ali Rıza Keskin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
İndirme çubuğu terminal ekranına uyum sağlayacak hale getirildi.
üst
ad41bb1f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
48 deletions
+29
-48
Makefile
Makefile
+1
-0
__init__.py
inary/cli/__init__.py
+5
-5
__init__.py
inary/misc/__init__.py
+0
-20
epoch2string.py
inary/misc/epoch2string.py
+0
-17
sort.py
inary/misc/sort.py
+17
-5
util.py
inary/util.py
+6
-1
No files found.
Makefile
Dosyayı görüntüle @
a70226fb
...
...
@@ -2,6 +2,7 @@ PREFIX=/
all
:
build install
clean
:
`
find |
grep
pycache |
sed
's/^/rm -rf /g'
`
rm
-rf
build
build
:
python3 setup.py build
...
...
inary/cli/__init__.py
Dosyayı görüntüle @
a70226fb
...
...
@@ -178,13 +178,13 @@ class CLI(inary.ui.UI):
elif
ka
[
'operation'
]
==
"fetching"
:
totalsize
=
'
%.1
f
%
s'
%
util
.
human_readable_size
(
ka
[
'total_size'
])
out
=
'
%-30.50
s(
%
s)
%3
d
%% %9.2
f
%
s[
%
s]'
%
\
(
ka
[
'filename'
],
totalsize
,
ka
[
'percent'
],
ka
[
'rate'
],
ka
[
'symbol'
],
ka
[
'eta'
])
self
.
output
(
'
\r\033
[2K'
+
util
.
colorize_percent
(
out
,
ka
[
'percent'
]))
out
=
'
%-30.50
s(
%
s)
'
%
(
ka
[
'filename'
],
totalsize
)
out2
=
'
%3
d
%% %9.2
f
%
s [
%
s]'
%
(
ka
[
'percent'
],
ka
[
'rate'
],
ka
[
'symbol'
],
ka
[
'eta'
])
self
.
output
(
'
\r\033
[2K'
+
util
.
colorize_percent
(
out
,
ka
[
'percent'
]
,
out2
))
util
.
xterm_title
(
"
%
s (
%
d
%%
)"
%
(
ka
[
'filename'
],
ka
[
'percent'
]))
else
:
self
.
output
(
"
\r\033
[2K"
+
colorize_percent
(
"
%
s (
%
d
%%
)"
%
(
ka
[
'info'
],
ka
[
'percent'
]),
ka
[
'percent'
]
))
self
.
output
(
"
\r\033
[2K"
+
colorize_percent
(
(
"
%
s"
%
ka
[
'info'
]),
ka
[
'percent'
],(
"(
%
d
%%
)"
%
ka
[
'percent'
])
))
util
.
xterm_title
(
"
%
s (
%
d
%%
)"
%
(
ka
[
'info'
],
ka
[
'percent'
]))
def
status
(
self
,
msg
=
None
,
push_screen
=
True
):
...
...
inary/misc/__init__.py
deleted
100644 → 0
Dosyayı görüntüle @
ad41bb1f
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019, Sulin Community
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# Please read the COPYING file.
#
import
inary.errors
class
Error
(
inary
.
errors
.
Error
):
pass
class
Exception
(
inary
.
errors
.
Exception
):
pass
inary/misc/epoch2string.py
deleted
100644 → 0
Dosyayı görüntüle @
ad41bb1f
# -*- coding:utf-8 -*-
#
import
time
letter
=
'abcdefghijklmnopqrstuvwyzABCDEFGHIJKLMNOPQRSTUWYZ'
len_letter
=
len
(
letter
)
def
nextString
(
length
=
0
):
source
=
str
(
int
(
time
.
time
()
*
10000000
))
if
length
>
len
(
source
)
or
length
<=
0
:
length
=
len
(
source
)
sr
=
""
while
length
>
1
:
sr
=
sr
+
letter
[
int
(
source
[
len
(
source
)
-
length
]
+
source
[
len
(
source
)
-
length
+
1
])
%
len
(
letter
)]
length
=
length
-
1
return
sr
inary/misc/
merge
sort.py
→
inary/misc/sort.py
Dosyayı görüntüle @
a70226fb
# -*- coding:utf-8 -*-
#Merge sort by sulincix
def
msort
(
x
):
def
sort_bubble
(
array
=
[]):
mlen
=
len
(
array
)
cout_i
=
0
while
cout_i
<
mlen
:
cout_j
=
0
while
cout_j
<
mlen
-
1
:
if
array
[
cout_j
-
1
]
>
array
[
cout_j
]:
tmp
=
array
[
cout_j
-
1
]
array
[
cout_j
-
1
]
=
array
[
cout_j
]
array
[
cout_j
]
=
tmp
cout_j
=
cout_j
+
1
cout_i
=
cout_i
+
1
return
array
def
sort_merge
(
x
):
result
=
[]
if
len
(
x
)
<
2
:
return
x
mid
=
int
(
len
(
x
)
/
2
)
y
=
msort
(
x
[:
mid
])
z
=
msort
(
x
[
mid
:])
y
=
sort_merge
(
x
[:
mid
])
z
=
sort_merge
(
x
[
mid
:])
while
(
len
(
y
)
>
0
)
or
(
len
(
z
)
>
0
):
if
len
(
y
)
>
0
and
len
(
z
)
>
0
:
if
y
[
0
]
>
z
[
0
]:
...
...
inary/util.py
Dosyayı görüntüle @
a70226fb
...
...
@@ -1048,7 +1048,12 @@ def colorize(msg, color):
else
:
return
str
(
msg
)
def
colorize_percent
(
msg
,
percent
,
color
=
'backgroundgreen'
,
color2
=
'backgroundyellow'
,
color3
=
'brightblue'
):
def
colorize_percent
(
message
,
percent
=
0
,
message2
=
' '
,
color
=
'backgroundgreen'
,
color2
=
'backgroundyellow'
,
color3
=
'brightblue'
):
term_rows
,
term_columns
=
get_terminal_size
()
spacenum
=
(
term_columns
-
(
len
(
message
)
+
len
(
message2
)))
if
spacenum
<
1
:
spacenum
=
0
msg
=
message
+
spacenum
*
' '
+
message2
if
len
(
msg
)
<
1
:
return
str
(
msg
)
lmsg
=
int
((
len
(
msg
)
*
percent
)
/
100
)
+
1
...
...
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