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
1b19999c
Kaydet (Commit)
1b19999c
authored
Agu 26, 2020
tarafından
Your Name
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Hewal öşex power with donkey lovers
üst
99d56132
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
9 deletions
+28
-9
__init__.py
inary/cli/__init__.py
+2
-2
configfile.py
inary/configfile.py
+3
-0
fetcher.py
inary/fetcher.py
+11
-6
preprocess.py
inary/libraries/preprocess.py
+1
-0
util.py
inary/util.py
+11
-1
No files found.
inary/cli/__init__.py
Dosyayı görüntüle @
1b19999c
...
...
@@ -200,8 +200,8 @@ class CLI(inary.ui.UI):
elif
ka
[
'operation'
]
==
"fetching"
:
if
not
ctx
.
get_option
(
"no_color"
):
complated_background
=
'backgroundgreen'
queried_background
=
'backgroundyellow'
complated_background
=
(
ka
[
'foregroundcolor'
]
or
'backgroundgreen'
)
queried_background
=
(
ka
[
'backgroundcolor'
]
or
'backgroundyellow'
)
else
:
complated_background
=
queried_background
=
"default"
...
...
inary/configfile.py
Dosyayı görüntüle @
1b19999c
...
...
@@ -59,6 +59,9 @@ import configparser
# INARY Modules
import
inary.errors
# Öşex like this
from
inary.util
import
hewal
as
eval
# Gettext Library
import
gettext
__trans
=
gettext
.
translation
(
'inary'
,
fallback
=
True
)
...
...
inary/fetcher.py
Dosyayı görüntüle @
1b19999c
...
...
@@ -83,12 +83,15 @@ class UIHandler:
self
.
s_time
=
self
.
now
()
def
update
(
self
,
total_to_download
,
total_downloaded
,
total_to_upload
=
0
,
total_uploaded
=
0
):
total_to_upload
=
0
,
total_uploaded
=
0
,
background_color
=
None
,
foreground_color
=
None
):
if
self
.
size
==
total_downloaded
:
return
self
.
size
=
total_downloaded
self
.
total_size
=
total_to_download
self
.
background
=
background_color
self
.
foreground
=
foreground_color
if
self
.
total_size
:
try
:
self
.
percent
=
(
self
.
size
*
100.0
)
/
self
.
total_size
...
...
@@ -122,7 +125,9 @@ class UIHandler:
rate
=
self
.
rate
,
eta
=
self
.
eta
,
symbol
=
self
.
symbol
,
basename
=
self
.
basename
)
basename
=
self
.
basename
,
backgroundcolor
=
self
.
background
,
foregroundcolor
=
self
.
foreground
)
self
.
last_updated
=
self
.
now
()
...
...
@@ -146,7 +151,7 @@ class Fetcher:
self
.
fetcher
=
None
# spoof user-agent
self
.
useragent
=
(
ctx
.
config
.
get_option
(
'fetcher_useragent'
)
self
.
useragent
=
(
ctx
.
config
.
values
.
general
.
fetcher_useragent
or
'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'
)
self
.
archive_file
=
os
.
path
.
join
(
destdir
,
destfile
or
url
.
filename
())
...
...
@@ -278,17 +283,17 @@ class Fetcher:
else
:
down
=
0
total
=
int
(
total
)
chunk
=
int
(
ctx
.
config
.
get_option
(
'fetcher_chunksize'
)
or
8196
)
chunk
=
int
(
ctx
.
config
.
values
.
general
.
fetcher_chunksize
or
8196
)
for
data
in
c
.
iter_content
(
chunk_size
=
chunk
):
self
.
file_id
.
write
(
data
)
down
+=
len
(
data
)
self
.
handler
.
update
(
total
,
down
)
self
.
handler
.
update
(
total
,
down
,
foreground_color
=
"backgroundblue"
)
ctx
.
ui
.
info
(
"
\n
"
,
noln
=
True
)
self
.
file_id
.
close
()
def
_get_fetcher_mode
(
self
):
if
not
self
.
fetcher
:
mode
=
int
(
ctx
.
config
.
get_option
(
'fetcher_mode'
)
or
0
)
mode
=
int
(
ctx
.
config
.
values
.
general
.
fetcher_mode
or
0
)
if
mode
==
0
or
mode
not
in
[
0
,
1
,
2
]:
try
:
import
pycurl
...
...
inary/libraries/preprocess.py
Dosyayı görüntüle @
1b19999c
...
...
@@ -132,6 +132,7 @@ import re
import
sys
# ---- exceptions
class
PreprocessError
(
Exception
):
...
...
inary/util.py
Dosyayı görüntüle @
1b19999c
...
...
@@ -340,6 +340,16 @@ def run_logged(cmd):
ctx
.
ui
.
debug
(
_
(
'return value for "{0}" is {1}'
)
.
format
(
cmd
,
p
.
returncode
))
return
p
.
returncode
def
hewal
(
expr
):
"""Eval with öşex power"""
expr
=
str
(
expr
)
.
upper
()
if
expr
in
(
"TRUE"
,
"1"
,
"ON"
,
"T"
,
"Y"
,
"YES"
):
return
True
elif
expr
in
(
"FALSE"
,
"0"
,
"OFF"
,
"F"
,
"N"
,
"NO"
):
return
False
return
None
########################
# Filesystem functions #
...
...
@@ -392,7 +402,7 @@ def initscr():
printw
(
"
\x1b
[s
\x1b
c"
)
def
end
src
():
def
end
win
():
"""Clear and restore screen"""
printw
(
"
\x1b
c
\x1b
[u"
)
...
...
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