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
14757a54
Kaydet (Commit)
14757a54
authored
Eyl 02, 2020
tarafından
Your Name
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
minor fix
üst
9caee2b8
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
100 additions
and
84 deletions
+100
-84
__init__.py
inary/actionsapi/__init__.py
+1
-0
archive.py
inary/archive.py
+1
-0
atomicoperations.py
inary/atomicoperations.py
+2
-2
__init__.py
inary/cli/__init__.py
+2
-0
blame.py
inary/cli/blame.py
+6
-6
checkrelation.py
inary/cli/checkrelation.py
+2
-3
listupgrades.py
inary/cli/listupgrades.py
+19
-13
removeorphaned.py
inary/cli/removeorphaned.py
+1
-1
constants.py
inary/constants.py
+1
-1
pgraph.py
inary/data/pgraph.py
+2
-2
errors.py
inary/errors.py
+10
-1
fetcher.py
inary/fetcher.py
+1
-1
build.py
inary/operations/build.py
+0
-1
install.py
inary/operations/install.py
+9
-9
upgrade.py
inary/operations/upgrade.py
+1
-1
trigger.py
inary/trigger.py
+4
-4
__init__.py
inary/util/__init__.py
+10
-12
curses.py
inary/util/curses.py
+1
-1
files.py
inary/util/files.py
+9
-7
filesystem_terminal.py
inary/util/filesystem_terminal.py
+6
-5
kernel.py
inary/util/kernel.py
+1
-1
misc.py
inary/util/misc.py
+2
-2
package.py
inary/util/package.py
+2
-1
path.py
inary/util/path.py
+3
-4
process.py
inary/util/process.py
+0
-1
strings.py
inary/util/strings.py
+4
-5
No files found.
inary/actionsapi/__init__.py
Dosyayı görüntüle @
14757a54
...
...
@@ -15,6 +15,7 @@
import
inary.context
as
ctx
from
inary.errors
import
Error
def
error
(
msg
):
if
ctx
.
config
.
get_option
(
'ignore_action_errors'
):
ctx
.
ui
.
error
(
msg
)
...
...
inary/archive.py
Dosyayı görüntüle @
14757a54
...
...
@@ -192,6 +192,7 @@ class ArchiveBinary(ArchiveBase):
# we can't unpack .bin files. we'll just move them to target
# directory and leave the dirty job to actions.py ;)
print
(
target_dir
)
target_file
=
os
.
path
.
join
(
target_dir
,
os
.
path
.
basename
(
self
.
file_path
))
if
os
.
path
.
isfile
(
self
.
file_path
):
...
...
inary/atomicoperations.py
Dosyayı görüntüle @
14757a54
...
...
@@ -519,7 +519,7 @@ class Install(AtomicOperation):
ctx
.
ui
.
info
(
_
(
"Precaching postoperations.py file"
),
verbose
=
True
)
if
'postOps'
in
self
.
metadata
.
package
.
isA
:
for
postops
in
ctx
.
const
.
postops
:
for
postops
in
ctx
.
const
.
postops
:
try
:
self
.
package
.
extract_file_synced
(
postops
,
ctx
.
config
.
tmp_dir
())
...
...
@@ -535,7 +535,7 @@ class Install(AtomicOperation):
self
.
package
.
extract_file_synced
(
ctx
.
const
.
metadata_xml
,
self
.
package
.
pkg_dir
())
if
'postOps'
in
self
.
metadata
.
package
.
isA
:
for
postops
in
ctx
.
const
.
postops
:
for
postops
in
ctx
.
const
.
postops
:
try
:
self
.
package
.
extract_file_synced
(
postops
,
ctx
.
config
.
tmp_dir
())
...
...
inary/cli/__init__.py
Dosyayı görüntüle @
14757a54
...
...
@@ -30,6 +30,8 @@ __trans = gettext.translation('inary', fallback=True)
_
=
__trans
.
gettext
# in old releases used this printu function
def
printu
(
obj
,
err
=
False
):
if
not
isinstance
(
obj
,
str
):
obj
=
str
(
obj
)
...
...
inary/cli/blame.py
Dosyayı görüntüle @
14757a54
...
...
@@ -73,17 +73,17 @@ Usage: blame <package> ... <package>
else
:
installed_pkg
=
self
.
installdb
.
get_package
(
package
)
if
not
release
and
not
ctx
.
get_option
(
'all'
):
self
.
print_package_info
(
pkg
,
installed
=
(
pkg
.
history
[
0
]
.
release
==
installed_pkg
.
history
[
0
]
.
release
))
self
.
print_package_info
(
pkg
,
installed
=
(
pkg
.
history
[
0
]
.
release
==
installed_pkg
.
history
[
0
]
.
release
))
elif
ctx
.
get_option
(
'all'
):
for
hno
,
update
in
enumerate
(
pkg
.
history
):
self
.
print_package_info
(
pkg
,
hno
,
(
installed_pkg
.
history
[
hno
]
and
installed_pkg
.
history
[
0
]
.
release
==
installed_pkg
.
history
[
hno
]
.
release
))
self
.
print_package_info
(
pkg
,
hno
,
(
installed_pkg
.
history
[
hno
]
and
installed_pkg
.
history
[
0
]
.
release
==
installed_pkg
.
history
[
hno
]
.
release
))
else
:
for
hno
,
update
in
enumerate
(
pkg
.
history
):
if
int
(
update
.
release
)
==
release
:
self
.
print_package_info
(
pkg
,
hno
,
(
installed_pkg
.
history
[
hno
]
and
installed_pkg
.
history
[
0
]
.
release
==
installed_pkg
.
history
[
hno
]
.
release
))
self
.
print_package_info
(
pkg
,
hno
,
(
installed_pkg
.
history
[
hno
]
and
installed_pkg
.
history
[
0
]
.
release
==
installed_pkg
.
history
[
hno
]
.
release
))
return
@staticmethod
...
...
inary/cli/checkrelation.py
Dosyayı görüntüle @
14757a54
...
...
@@ -48,7 +48,7 @@ Usage: check-relation
self
.
parser
.
add_option_group
(
group
)
def
fix_reinstall
(
self
,
need_reinstall
):
def
fix_reinstall
(
self
,
need_reinstall
):
need_reinstall
=
util
.
unique_list
(
need_reinstall
)
if
len
(
need_reinstall
)
>
0
:
sys
.
stderr
.
write
(
...
...
@@ -71,7 +71,7 @@ Usage: check-relation
installed
.
sort
()
need_reinstall
=
[]
for
pkg
in
installed
:
for
p
in
self
.
installdb
.
get_package
(
pkg
)
.
runtimeDependencies
():
sys
.
stderr
.
write
(
_
(
"Checking: {}"
)
.
format
(
p
)
+
"
\r
"
)
...
...
@@ -92,4 +92,3 @@ Usage: check-relation
sys
.
stderr
.
write
(
_
(
"Missing: /{} - {}"
)
.
format
(
f
.
path
,
pkg
)
+
"
\n
"
)
self
.
fix_reinstall
(
need_reinstall
)
inary/cli/listupgrades.py
Dosyayı görüntüle @
14757a54
...
...
@@ -12,6 +12,11 @@
# Please read the COPYING file.
#
import
inary.operations
as
operations
import
inary.db
import
inary.context
as
ctx
import
inary.blacklist
import
inary.cli.command
as
command
import
optparse
import
sys
...
...
@@ -20,12 +25,6 @@ import gettext
__trans
=
gettext
.
translation
(
'inary'
,
fallback
=
True
)
_
=
__trans
.
gettext
import
inary.cli.command
as
command
import
inary.blacklist
import
inary.context
as
ctx
import
inary.db
import
inary.operations
as
operations
class
ListUpgrades
(
command
.
Command
,
metaclass
=
command
.
autocommand
):
__doc__
=
_
(
"""List packages to be upgraded
...
...
@@ -64,14 +63,17 @@ Lists the packages that will be upgraded.
# upgradable_pkgs.extend(list_replaces())
# consider also blacklist filtering
upgradable_pkgs
=
inary
.
blacklist
.
exclude_from
(
upgradable_pkgs
,
ctx
.
const
.
blacklist
)
upgradable_pkgs
=
inary
.
blacklist
.
exclude_from
(
upgradable_pkgs
,
ctx
.
const
.
blacklist
)
component
=
ctx
.
get_option
(
'component'
)
if
component
:
component_pkgs
=
self
.
componentdb
.
get_union_packages
(
component
,
walk
=
True
)
component_pkgs
=
self
.
componentdb
.
get_union_packages
(
component
,
walk
=
True
)
upgradable_pkgs
=
list
(
set
(
upgradable_pkgs
)
&
set
(
component_pkgs
))
upgradable_pkgs
=
inary
.
blacklist
.
exclude_from
(
upgradable_pkgs
,
ctx
.
const
.
blacklist
)
upgradable_pkgs
=
inary
.
blacklist
.
exclude_from
(
upgradable_pkgs
,
ctx
.
const
.
blacklist
)
if
not
upgradable_pkgs
:
ctx
.
ui
.
info
(
_
(
'No packages to upgrade.'
))
...
...
@@ -83,8 +85,10 @@ Lists the packages that will be upgraded.
maxlen
=
max
([
len
(
_p
)
for
_p
in
upgradable_pkgs
])
if
self
.
options
.
install_info
:
ctx
.
ui
.
info
(
_
(
'Package Name |St| Version| Rel.| Distro| Date'
))
sys
.
stdout
.
write
(
'==========================================================================='
)
ctx
.
ui
.
info
(
_
(
'Package Name |St| Version| Rel.| Distro| Date'
))
sys
.
stdout
.
write
(
'==========================================================================='
)
for
pkg
in
upgradable_pkgs
:
package
=
self
.
installdb
.
get_package
(
pkg
)
...
...
@@ -93,7 +97,9 @@ Lists the packages that will be upgraded.
ctx
.
ui
.
info
(
package
)
sys
.
stdout
.
write
(
inst_info
)
elif
self
.
options
.
install_info
:
ctx
.
ui
.
info
(
'
%-20
s |
%
s '
%
(
package
.
name
,
inst_info
.
one_liner
()))
ctx
.
ui
.
info
(
'
%-20
s |
%
s '
%
(
package
.
name
,
inst_info
.
one_liner
()))
else
:
package
.
name
+=
' '
*
max
(
0
,
maxlen
-
len
(
package
.
name
))
ctx
.
ui
.
info
(
'{0} - {1}'
.
format
(
package
.
name
,
str
(
package
.
summary
)))
ctx
.
ui
.
info
(
'{0} - {1}'
.
format
(
package
.
name
,
str
(
package
.
summary
)))
inary/cli/removeorphaned.py
Dosyayı görüntüle @
14757a54
...
...
@@ -62,7 +62,7 @@ Remove all orphaned packages from the system.
if
ctx
.
get_option
(
'exclude'
):
orphaned
=
inary
.
blacklist
.
exclude
(
orphaned
,
ctx
.
get_option
(
'exclude'
))
if
len
(
orphaned
)
>
0
:
remove
.
remove
(
orphaned
,
confirm
=
first
)
first
=
False
...
...
inary/constants.py
Dosyayı görüntüle @
14757a54
...
...
@@ -107,7 +107,7 @@ class Constants(metaclass=Singleton):
self
.
__c
.
translations_file
=
"translations.xml"
self
.
__c
.
files_xml
=
"files.xml"
self
.
__c
.
metadata_xml
=
"metadata.xml"
self
.
__c
.
postops
=
[
"postoperations.py"
,
"postoperations.sh"
]
self
.
__c
.
postops
=
[
"postoperations.py"
,
"postoperations.sh"
]
self
.
__c
.
install_tar
=
"install.tar"
self
.
__c
.
mirrors_conf
=
"/etc/inary/mirrors.conf"
self
.
__c
.
blacklist
=
"/etc/inary/blacklist"
...
...
inary/data/pgraph.py
Dosyayı görüntüle @
14757a54
...
...
@@ -41,10 +41,10 @@ class PGraph:
if
not
packagedb
:
self
.
packagedb
=
inary
.
db
.
packagedb
.
PackageDB
()
def
get_installdb
(
self
):
return
self
.
installdb
def
get_packagedb
(
self
):
return
self
.
packagedb
...
...
inary/errors.py
Dosyayı görüntüle @
14757a54
...
...
@@ -13,6 +13,7 @@
from
gettext
import
translation
_
=
translation
(
'inary'
,
fallback
=
True
)
.
gettext
class
Error
(
Exception
):
"""Class of exceptions that lead to program termination"""
pass
...
...
@@ -26,6 +27,8 @@ class PrivilegeError(Error):
pass
# Error Classes
class
FileError
(
Error
):
def
__init__
(
self
,
value
=
''
):
Error
.
__init__
(
self
,
value
)
...
...
@@ -37,10 +40,13 @@ class ArgumentError(Error):
Error
.
__init__
(
self
,
value
)
self
.
value
=
value
class
FilePermissionDeniedError
(
Error
):
pass
# Error Classes
class
FileError
(
Error
):
def
__init__
(
self
,
value
=
''
):
Error
.
__init__
(
self
,
value
)
...
...
@@ -52,6 +58,7 @@ class ArgumentError(Error):
Error
.
__init__
(
self
,
value
)
self
.
value
=
value
class
AlreadyHaveException
(
Error
):
def
__init__
(
self
,
url
,
localfile
):
Error
.
__init__
(
...
...
@@ -67,12 +74,14 @@ class NoSignatureFound(Error):
self
,
_
(
"No signature found for
\"
{}
\"
"
)
.
format
(
url
))
self
.
url
=
url
class
InvalidSignature
(
Error
):
def
__init__
(
self
,
url
):
Error
.
__init__
(
self
,
_
(
"GPG Signature is invalid for
\"
{}
\"
"
)
.
format
(
url
))
self
.
url
=
url
class
CycleException
(
Error
):
def
__init__
(
self
,
cycle
):
self
.
cycle
=
cycle
...
...
@@ -80,6 +89,7 @@ class CycleException(Error):
def
__str__
(
self
):
return
_
(
'Encountered cycle {}'
)
.
format
(
self
.
cycle
)
class
ParserError
(
Error
):
pass
...
...
@@ -90,4 +100,3 @@ class PostOpsError(Error):
class
NotfoundError
(
Error
):
pass
inary/fetcher.py
Dosyayı görüntüle @
14757a54
...
...
@@ -135,7 +135,7 @@ class UIHandler:
class
Fetcher
:
"""Fetcher can fetch a file from various sources using various
protocols."""
FETCH_MODE_PYCURL
=
1
FETCH_MODE_REQUESTS
=
2
FETCH_MODE_WGET
=
3
...
...
inary/operations/build.py
Dosyayı görüntüle @
14757a54
...
...
@@ -687,7 +687,6 @@ class Builder:
# mode is octal!
os
.
chmod
(
dest
,
int
(
afile
.
permission
,
8
))
def
get_action_variable
(
self
,
name
,
default
):
if
name
in
self
.
variable_buffer
.
keys
():
return
self
.
variable_buffer
[
name
]
...
...
inary/operations/install.py
Dosyayı görüntüle @
14757a54
...
...
@@ -170,15 +170,15 @@ def install_pkg_files(package_URIs, reinstall=False):
# filter packages that are already installed
tobe_installed
,
already_installed
=
[],
set
()
if
not
reinstall
:
for
x
in
package_URIs
:
pkg_name
=
util
.
parse_package_name_get_name
(
os
.
path
.
basename
(
x
))
if
installdb
.
has_package
(
pkg_name
):
already_installed
.
add
(
pkg_name
)
else
:
tobe_installed
.
append
(
x
)
pkg_name
=
util
.
parse_package_name_get_name
(
os
.
path
.
basename
(
x
))
if
installdb
.
has_package
(
pkg_name
):
already_installed
.
add
(
pkg_name
)
else
:
tobe_installed
.
append
(
x
)
if
already_installed
:
ctx
.
ui
.
warning
(
_
(
"The following package(s) are already installed "
"and are not going to be installed again:"
))
...
...
@@ -284,8 +284,8 @@ def install_pkg_files(package_URIs, reinstall=False):
for
x
in
B
:
pkg
=
packagedb
.
get_package
(
x
)
G_f
.
add_package
(
x
)
#for dep in pkg.runtimeDependencies():
# G_f.add_package(dep)
#
for dep in pkg.runtimeDependencies():
# G_f.add_package(dep)
B
=
Bp
order
=
G_f
.
topological_sort
()
if
not
ctx
.
get_option
(
'ignore_package_conflicts'
):
...
...
inary/operations/upgrade.py
Dosyayı görüntüle @
14757a54
...
...
@@ -280,7 +280,7 @@ def plan_upgrade(A, force_replaced=True, replaces=None):
# install / reinstall
G_f
=
pgraph
.
PGraph
()
# construct G_f
installdb
=
G_f
.
get_installdb
()
packagedb
=
G_f
.
get_packagedb
()
...
...
inary/trigger.py
Dosyayı görüntüle @
14757a54
...
...
@@ -48,9 +48,9 @@ class Trigger:
cmd_extra
=
" > /dev/null"
ret_val
=
os
.
system
(
'bash --noprofile --norc -c
\'
source postoperations.sh ; if declare -F {0} &>/dev/null ; then {0} ; fi
\'
'
.
format
(
func
)
+
cmd_extra
)
cmd_extra
)
os
.
chdir
(
curDir
)
if
(
ret_val
!=
0
):
if
(
ret_val
!=
0
):
return
False
if
os
.
path
.
exists
(
self
.
specdir
+
"/"
+
ctx
.
const
.
postops
[
0
]):
curDir
=
os
.
getcwd
()
...
...
@@ -71,7 +71,7 @@ class Trigger:
'python3 -c
\'
import postoperations
\n
if(hasattr(postoperations,"{0}")):
\n
postoperations.{0}()
\'
'
.
format
(
func
)
+
cmd_extra
)
os
.
chdir
(
curDir
)
if
(
ret_val
!=
0
):
if
(
ret_val
!=
0
):
return
False
return
True
...
...
@@ -98,5 +98,5 @@ class Trigger:
def
preremove
(
self
,
specdir
):
self
.
specdir
=
specdir
for
postops
in
ctx
.
const
.
postops
:
self
.
postscript
=
util
.
join_path
(
self
.
specdir
,
postops
)
self
.
postscript
=
util
.
join_path
(
self
.
specdir
,
postops
)
return
self
.
run_command
(
"preRemove"
)
inary/util/__init__.py
Dosyayı görüntüle @
14757a54
...
...
@@ -15,6 +15,16 @@
"""misc. utility functions, including process and file utils"""
# Inary Modules
from
inary.util.strings
import
*
from
inary.util.process
import
*
from
inary.util.path
import
*
from
inary.util.package
import
*
from
inary.util.misc
import
*
from
inary.util.kernel
import
*
from
inary.util.filesystem_terminal
import
*
from
inary.util.files
import
*
from
inary.util.curses
import
*
import
fcntl
import
inary
import
inary.errors
import
inary.context
as
ctx
...
...
@@ -24,18 +34,6 @@ import gettext
__trans
=
gettext
.
translation
(
'inary'
,
fallback
=
True
)
_
=
__trans
.
gettext
import
fcntl
from
inary.util.curses
import
*
from
inary.util.files
import
*
from
inary.util.filesystem_terminal
import
*
from
inary.util.kernel
import
*
from
inary.util.misc
import
*
from
inary.util.package
import
*
from
inary.util.path
import
*
from
inary.util.process
import
*
from
inary.util.strings
import
*
class
Singleton
(
type
):
def
__init__
(
cls
,
name
,
bases
,
dict
):
...
...
inary/util/curses.py
Dosyayı görüntüle @
14757a54
...
...
@@ -15,6 +15,7 @@
"""misc. utility functions, including process and file utils"""
# Inary Modules
import
sys
import
inary
import
inary.errors
import
inary.context
as
ctx
...
...
@@ -24,7 +25,6 @@ import gettext
__trans
=
gettext
.
translation
(
'inary'
,
fallback
=
True
)
_
=
__trans
.
gettext
import
sys
#############################
# ncurses like functions #
...
...
inary/util/files.py
Dosyayı görüntüle @
14757a54
...
...
@@ -14,7 +14,14 @@
"""misc. utility functions, including process and file utils"""
import
os
,
re
from
inary.errors
import
FileError
,
FilePermissionDeniedError
from
inary.util.strings
import
remove_prefix
from
inary.util.process
import
run_batch
import
fnmatch
import
hashlib
import
shutil
import
os
import
re
# Inary Modules
import
inary
...
...
@@ -26,16 +33,12 @@ import gettext
__trans
=
gettext
.
translation
(
'inary'
,
fallback
=
True
)
_
=
__trans
.
gettext
import
shutil
import
hashlib
import
fnmatch
from
inary.util.strings
import
remove_prefix
from
inary.errors
import
FileError
,
FilePermissionDeniedError
####################################
# File/Directory Related Functions #
####################################
def
check_file
(
_file
,
mode
=
os
.
F_OK
,
noerr
=
False
):
"""Shorthand to check if a file exists."""
if
not
os
.
access
(
_file
,
mode
):
...
...
@@ -441,4 +444,3 @@ def partition_freespace(directory):
"""Return free space of given directory's partition."""
st
=
os
.
statvfs
(
directory
)
return
st
.
f_frsize
*
st
.
f_bfree
inary/util/filesystem_terminal.py
Dosyayı görüntüle @
14757a54
...
...
@@ -15,6 +15,11 @@
"""misc. utility functions, including process and file utils"""
# Inary Modules
import
struct
import
termios
import
fcntl
import
sys
import
os
import
inary
import
inary.errors
import
inary.context
as
ctx
...
...
@@ -24,16 +29,12 @@ import gettext
__trans
=
gettext
.
translation
(
'inary'
,
fallback
=
True
)
_
=
__trans
.
gettext
import
os
import
sys
import
fcntl
import
termios
import
struct
########################
# Filesystem functions #
########################
def
fs_sync
():
if
ctx
.
config
.
values
.
general
.
fs_sync
:
ctx
.
ui
.
debug
(
...
...
inary/util/kernel.py
Dosyayı görüntüle @
14757a54
...
...
@@ -15,6 +15,7 @@
"""misc. utility functions, including process and file utils"""
# Inary Modules
import
platform
import
inary
import
inary.errors
import
inary.context
as
ctx
...
...
@@ -24,7 +25,6 @@ import gettext
__trans
=
gettext
.
translation
(
'inary'
,
fallback
=
True
)
_
=
__trans
.
gettext
import
platform
def
get_kernel_option
(
option
):
"""Get a dictionary of args for the given kernel command line option"""
...
...
inary/util/misc.py
Dosyayı görüntüle @
14757a54
...
...
@@ -15,6 +15,7 @@
"""misc. utility functions, including process and file utils"""
# Inary Modules
from
unicodedata
import
category
as
ucategory
import
inary.context
as
ctx
from
os
import
listdir
,
path
,
readlink
,
rmdir
from
sys
import
maxunicode
...
...
@@ -25,7 +26,6 @@ import gettext
__trans
=
gettext
.
translation
(
'inary'
,
fallback
=
True
)
_
=
__trans
.
gettext
from
unicodedata
import
category
as
ucategory
def
join_path
(
a
,
*
p
):
"""Join two or more pathname components.
...
...
@@ -40,6 +40,7 @@ def join_path(a, *p):
path
+=
'/'
+
b
return
path
def
colorize
(
msg
,
color
):
"""Colorize the given message for console output"""
if
color
in
ctx
.
const
.
colors
and
not
(
ctx
.
get_option
(
...
...
@@ -91,4 +92,3 @@ def letters():
result
.
append
(
start
+
"-"
+
end
)
start
=
None
return
''
.
join
(
result
)
inary/util/package.py
Dosyayı görüntüle @
14757a54
...
...
@@ -15,6 +15,7 @@
"""misc. utility functions, including process and file utils"""
# Inary Modules
from
inary.util.strings
import
*
import
inary
import
inary.errors
import
inary.context
as
ctx
...
...
@@ -24,12 +25,12 @@ import gettext
__trans
=
gettext
.
translation
(
'inary'
,
fallback
=
True
)
_
=
__trans
.
gettext
from
inary.util.strings
import
*
########################################
# Package/Repository Related Functions #
########################################
def
package_filename
(
name
,
version
,
release
,
distro_id
=
None
,
arch
=
None
):
"""Return a filename for a package with the given information. """
...
...
inary/util/path.py
Dosyayı görüntüle @
14757a54
...
...
@@ -14,6 +14,9 @@
"""misc. utility functions, including process and file utils"""
from
inary.util.strings
import
*
import
struct
from
functools
import
reduce
import
os
# Inary Modules
...
...
@@ -26,9 +29,6 @@ import gettext
__trans
=
gettext
.
translation
(
'inary'
,
fallback
=
True
)
_
=
__trans
.
gettext
from
functools
import
reduce
import
struct
from
inary.util.strings
import
*
#############################
# Path Processing Functions #
...
...
@@ -89,4 +89,3 @@ def join_path(a, *p):
else
:
path
+=
'/'
+
b
return
path
inary/util/process.py
Dosyayı görüntüle @
14757a54
...
...
@@ -97,4 +97,3 @@ def hewal(expr):
elif
expr
in
(
"FALSE"
,
"0"
,
"OFF"
,
"F"
,
"N"
,
"NO"
):
return
False
return
None
inary/util/strings.py
Dosyayı görüntüle @
14757a54
...
...
@@ -15,6 +15,10 @@
"""misc. utility functions, including process and file utils"""
# Inary Modules
from
inary.util.filesystem_terminal
import
get_terminal_size
import
operator
from
inary.util.filesystem_terminal
import
*
from
functools
import
reduce
import
inary
import
inary.errors
import
inary.context
as
ctx
...
...
@@ -24,10 +28,6 @@ import gettext
__trans
=
gettext
.
translation
(
'inary'
,
fallback
=
True
)
_
=
__trans
.
gettext
from
functools
import
reduce
from
inary.util.filesystem_terminal
import
*
import
operator
from
inary.util.filesystem_terminal
import
get_terminal_size
#########################
# string/list/functional#
...
...
@@ -203,4 +203,3 @@ def format_by_columns(strings, sep_width=2):
lines
.
append
(
sep
.
join
(
current_line
))
return
"
\n
"
.
join
(
lines
)
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