Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
S
scom
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
scom
Commits
83aa0d26
Kaydet (Commit)
83aa0d26
authored
Agu 09, 2019
tarafından
Suleyman Poyraz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Python 3.7 üzeri async parametresinden dolayı çıkan sorun düzeltildi.
üst
a497f557
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
__init__.py
api/scom/__init__.py
+8
-8
No files found.
api/scom/__init__.py
Dosyayı görüntüle @
83aa0d26
...
...
@@ -24,7 +24,7 @@ class Call:
self
.
class_
=
class_
self
.
package
=
package
self
.
method
=
method
self
.
async
=
None
self
.
as
s
ync
=
None
self
.
quiet
=
False
if
self
.
package
:
...
...
@@ -55,24 +55,24 @@ class Call:
yield
str
(
package
)
def
call
(
self
,
*
args
,
**
kwargs
):
self
.
async
=
kwargs
.
get
(
"async"
,
None
)
self
.
as
s
ync
=
kwargs
.
get
(
"async"
,
None
)
self
.
quiet
=
kwargs
.
get
(
"quiet"
,
False
)
self
.
timeout
=
kwargs
.
get
(
"timeout"
,
120
)
if
self
.
async
and
self
.
quiet
:
if
self
.
as
s
ync
and
self
.
quiet
:
raise
Exception
(
"async and quiet arguments can't be used together"
)
if
self
.
async
or
self
.
quiet
:
if
self
.
as
s
ync
or
self
.
quiet
:
if
self
.
package
:
obj
=
self
.
link
.
bus
.
get_object
(
self
.
link
.
address
,
"/package/
%
s"
%
self
.
package
)
met
=
getattr
(
obj
,
self
.
method
)
def
handleResult
(
*
result
):
self
.
async
(
self
.
package
,
None
,
result
)
self
.
as
s
ync
(
self
.
package
,
None
,
result
)
def
handleError
(
exception
):
if
"policy.auth"
in
exception
.
_dbus_error_name
or
"Scom.PolicyKit"
in
exception
.
_dbus_error_name
:
action
=
exception
.
get_dbus_message
()
if
self
.
queryPolicyKit
(
action
):
return
self
.
call
(
*
args
,
**
kwargs
)
self
.
async
(
self
.
package
,
exception
,
None
)
self
.
as
s
ync
(
self
.
package
,
exception
,
None
)
if
self
.
quiet
:
met
(
dbus_interface
=
"
%
s.
%
s.
%
s"
%
(
self
.
link
.
interface
,
self
.
group
,
self
.
class_
),
*
args
)
...
...
@@ -88,11 +88,11 @@ class Call:
else
:
def
handleResult
(
package
):
def
handler
(
*
result
):
return
self
.
async
(
package
,
None
,
result
)
return
self
.
as
s
ync
(
package
,
None
,
result
)
return
handler
def
handleError
(
package
):
def
handler
(
exception
):
return
self
.
async
(
package
,
exception
,
None
)
return
self
.
as
s
ync
(
package
,
exception
,
None
)
return
handler
for
package
in
packages
:
...
...
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