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
5b364139
Kaydet (Commit)
5b364139
authored
May 10, 2018
tarafından
Suleyman Poyraz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
util parçalanması sonrası değişimler yapıldı
üst
561c2629
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
11 deletions
+37
-11
config.py
inary/config.py
+3
-1
constants.py
inary/constants.py
+10
-1
lazydb.py
inary/db/lazydb.py
+1
-2
scomiface.py
inary/scomiface.py
+11
-5
ui.py
inary/ui.py
+1
-1
__init__.py
inary/util/__init__.py
+11
-1
No files found.
inary/config.py
Dosyayı görüntüle @
5b364139
...
...
@@ -28,6 +28,7 @@ import inary.context as ctx
import
inary.configfile
import
inary.errors
import
inary.util
from
inary.util
import
Singleton
class
Error
(
inary
.
errors
.
Error
):
pass
...
...
@@ -42,7 +43,8 @@ class Options(object):
def
__setattr__
(
self
,
name
,
value
):
self
.
__dict__
[
name
]
=
value
class
Config
(
object
,
metaclass
=
inary
.
util
.
Singleton
):
class
Config
(
object
,
metaclass
=
Singleton
):
"""Config Singleton"""
def
__init__
(
self
,
options
=
Options
()):
...
...
inary/constants.py
Dosyayı görüntüle @
5b364139
...
...
@@ -20,7 +20,16 @@ import gettext
__trans
=
gettext
.
translation
(
'inary'
,
fallback
=
True
)
_
=
__trans
.
gettext
from
inary.util
import
Singleton
class
Singleton
(
type
):
def
__init__
(
cls
,
name
,
bases
,
dict
):
super
(
Singleton
,
cls
)
.
__init__
(
name
,
bases
,
dict
)
cls
.
instance
=
None
def
__call__
(
cls
,
*
args
,
**
kw
):
if
cls
.
instance
is
None
:
cls
.
instance
=
super
(
Singleton
,
cls
)
.
__call__
(
*
args
,
**
kw
)
return
cls
.
instance
class
_constant
:
"Constant members implementation"
...
...
inary/db/lazydb.py
Dosyayı görüntüle @
5b364139
...
...
@@ -18,9 +18,8 @@ import time
import
inary.context
as
ctx
import
inary.util
as
util
from
..
import
strutils
# lower borks for international locales. What we want is ascii lower.
lower_map
=
str
.
maketrans
(
strutils
.
ascii_uppercase
,
strutils
.
ascii_lowercase
)
lower_map
=
str
.
maketrans
(
util
.
ascii_uppercase
,
util
.
ascii_lowercase
)
class
Singleton
(
object
):
...
...
inary/scomiface.py
Dosyayı görüntüle @
5b364139
...
...
@@ -14,7 +14,6 @@
import
os
import
time
from
.
import
strutils
import
gettext
__trans
=
gettext
.
translation
(
'inary'
,
fallback
=
True
)
...
...
@@ -23,6 +22,7 @@ _ = __trans.gettext
import
inary.api
import
inary.context
as
ctx
import
inary.errors
import
inary.util
as
util
class
Error
(
inary
.
errors
.
Error
):
pass
...
...
@@ -36,7 +36,7 @@ except ImportError:
def
is_char_valid
(
char
):
"""Test if char is valid object path character."""
return
char
in
strutils
.
ascii_letters
+
strutils
.
digits
+
"_"
return
char
in
util
.
ascii_letters
+
util
.
digits
+
"_"
def
is_method_missing
(
exception
):
"""Tells if exception is about missing method in SCOM script"""
...
...
@@ -84,9 +84,15 @@ def get_link():
link
.
setLocale
()
return
link
except
dbus
.
exceptions
.
DBusException
as
e
:
exceptions
.
append
(
str
(
e
))
except
Exception
as
e
:
exceptions
.
append
(
str
(
e
))
if
str
(
e
)
in
exceptions
:
pass
else
:
exceptions
.
append
(
str
(
e
))
except
Exception
as
e
:
if
str
(
e
)
in
exceptions
:
pass
else
:
exceptions
.
append
(
str
(
e
))
time
.
sleep
(
0.2
)
timeout
-=
0.2
raise
Error
(
_
(
"Cannot connect to SCOM:
\n
{}
\n
"
)
.
format
(
"
\n
"
.
join
(
exceptions
)))
...
...
inary/ui.py
Dosyayı görüntüle @
5b364139
...
...
@@ -53,7 +53,7 @@ class UI(object):
def
set_debug
(
self
,
flag
):
self
.
show_debug
=
flag
def
info
(
self
,
msg
,
verbose
=
False
,
noln
=
False
):
def
info
(
self
,
msg
,
verbose
=
False
,
noln
=
False
,
color
=
'default'
):
"give an informative message"
pass
...
...
inary/util/__init__.py
Dosyayı görüntüle @
5b364139
...
...
@@ -18,7 +18,6 @@ __trans = gettext.translation('inary', fallback=True)
_
=
__trans
.
gettext
import
inary
import
inary.context
as
ctx
from
.file_utils
import
*
from
.package_utils
import
*
...
...
@@ -26,3 +25,14 @@ from .path_utils import *
from
.process_utils
import
*
from
.term_utils
import
*
from
.type_utils
import
*
class
Singleton
(
type
):
def
__init__
(
cls
,
name
,
bases
,
dict
):
super
(
Singleton
,
cls
)
.
__init__
(
name
,
bases
,
dict
)
cls
.
instance
=
None
def
__call__
(
cls
,
*
args
,
**
kw
):
if
cls
.
instance
is
None
:
cls
.
instance
=
super
(
Singleton
,
cls
)
.
__call__
(
*
args
,
**
kw
)
return
cls
.
instance
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