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
9d916e76
Kaydet (Commit)
9d916e76
authored
Şub 11, 2018
tarafından
Suleyman Poyraz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
string fonksiyonu yerine strutils kullanilacak
üst
ba94a323
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
10 deletions
+21
-10
lazydb.py
inary/db/lazydb.py
+2
-2
scomiface.py
inary/scomiface.py
+2
-2
strutils.py
inary/strutils.py
+11
-0
util.py
inary/util.py
+6
-6
No files found.
inary/db/lazydb.py
Dosyayı görüntüle @
9d916e76
...
...
@@ -16,9 +16,9 @@ import time
import
inary.context
as
ctx
import
inary.util
as
util
import
string
from
..
import
strutils
# lower borks for international locales. What we want is ascii lower.
lower_map
=
str
.
maketrans
(
str
ing
.
ascii_uppercase
,
string
.
ascii_lowercase
)
lower_map
=
str
.
maketrans
(
str
utils
.
ascii_uppercase
,
strutils
.
ascii_lowercase
)
class
Singleton
(
object
):
...
...
inary/scomiface.py
Dosyayı görüntüle @
9d916e76
...
...
@@ -12,7 +12,7 @@
import
os
import
time
import
string
from
.
import
strutils
import
gettext
__trans
=
gettext
.
translation
(
'inary'
,
fallback
=
True
)
...
...
@@ -32,7 +32,7 @@ except ImportError:
def
is_char_valid
(
char
):
"""Test if char is valid object path character."""
return
char
in
str
ing
.
ascii_letters
+
string
.
digits
+
"_"
return
char
in
str
utils
.
ascii_letters
+
strutils
.
digits
+
"_"
def
is_method_missing
(
exception
):
"""Tells if exception is about missing method in SCOM script"""
...
...
inary/strutils.py
Dosyayı görüntüle @
9d916e76
...
...
@@ -15,6 +15,16 @@
import
operator
from
functools
import
reduce
whitespace
=
'
\t\n\r\v\f
'
ascii_lowercase
=
'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase
=
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_letters
=
ascii_lowercase
+
ascii_uppercase
digits
=
'0123456789'
hexdigits
=
digits
+
'abcdef'
+
'ABCDEF'
octdigits
=
'01234567'
punctuation
=
"""!"#$
%
&'()*+,-./:;<=>?@[
\
]^_`{|}~"""
printable
=
digits
+
ascii_letters
+
punctuation
+
whitespace
def
every
(
pred
,
seq
):
return
reduce
(
operator
.
and_
,
list
(
map
(
pred
,
seq
)),
True
)
...
...
@@ -86,3 +96,4 @@ def ascii_upper(str):
"""Ascii only version of string.upper()"""
trans_table
=
str
.
maketrans
(
str
.
ascii_lowercase
,
str
.
ascii_uppercase
)
return
str
.
translate
(
trans_table
)
inary/util.py
Dosyayı görüntüle @
9d916e76
...
...
@@ -19,7 +19,7 @@ import re
import
sys
import
fcntl
import
shutil
import
string
from
.
import
strutils
import
struct
import
fnmatch
import
hashlib
...
...
@@ -671,7 +671,7 @@ def parse_package_name_legacy(package_name):
# We should handle package names like 855resolution
name
=
[]
for
part
in
package_name
.
split
(
"-"
):
if
name
!=
[]
and
part
[
0
]
in
str
ing
.
digits
:
if
name
!=
[]
and
part
[
0
]
in
str
utils
.
digits
:
break
else
:
name
.
append
(
part
)
...
...
@@ -697,7 +697,7 @@ def parse_package_name(package_name):
# Arch field cannot start with a digit. If a digit is found,
# the package might have an old format. Raise here to call
# the legacy function.
if
not
arch
or
arch
[
0
]
in
str
ing
.
digits
:
if
not
arch
or
arch
[
0
]
in
str
utils
.
digits
:
raise
ValueError
except
ValueError
:
...
...
@@ -742,7 +742,7 @@ def parse_delta_package_name(package_name):
# Arch field cannot start with a digit. If a digit is found,
# the package might have an old format. Raise here to call
# the legacy function.
if
not
arch
or
arch
[
0
]
in
str
ing
.
digits
:
if
not
arch
or
arch
[
0
]
in
str
utils
.
digits
:
raise
ValueError
except
ValueError
:
...
...
@@ -768,7 +768,7 @@ def split_package_filename(filename):
# Arch field cannot start with a digit. If a digit is found,
# the package might have an old format.
if
not
arch
or
arch
[
0
]
in
str
ing
.
digits
:
if
not
arch
or
arch
[
0
]
in
str
utils
.
digits
:
raise
ValueError
except
ValueError
:
...
...
@@ -794,7 +794,7 @@ def split_delta_package_filename(filename):
# Arch field cannot start with a digit. If a digit is found,
# the package might have an old format.
if
not
arch
or
arch
[
0
]
in
str
ing
.
digits
:
if
not
arch
or
arch
[
0
]
in
str
utils
.
digits
:
raise
ValueError
except
ValueError
:
...
...
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