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
32c2d57d
Kaydet (Commit)
32c2d57d
authored
May 10, 2009
tarafından
Bahadır Kandemir
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Moved common network code under comar.network
üst
4f2fd6b0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
117 additions
and
5 deletions
+117
-5
ChangeLog
api/ChangeLog
+3
-0
__init__.py
api/comar/__init__.py
+1
-1
network.py
api/comar/network.py
+109
-0
service.py
api/comar/service.py
+2
-2
utility.py
api/comar/utility.py
+1
-1
setup.py
api/setup.py
+1
-1
No files found.
api/ChangeLog
Dosyayı görüntüle @
32c2d57d
2009-05-10 Bahadır Kandemir <bahadir@pardus.org.tr>
* network: Moved common network code under comar.network module.
2009-05-07 Bahadır Kandemir <bahadir@pardus.org.tr>
2009-05-07 Bahadır Kandemir <bahadir@pardus.org.tr>
* api: Do nothing if PolicyKit is unavailable
* api: Do nothing if PolicyKit is unavailable
...
...
api/comar/__init__.py
Dosyayı görüntüle @
32c2d57d
#!/usr/bin/python
#!/usr/bin/python
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
#
#
# Copyright (C) 2006-200
8
, TUBITAK/UEKAE
# Copyright (C) 2006-200
9
, TUBITAK/UEKAE
#
#
# This program is free software; you can redistribute it and/or modify it
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# under the terms of the GNU General Public License as published by the
...
...
api/comar/network.py
0 → 100644
Dosyayı görüntüle @
32c2d57d
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# Please read the COPYING file.
#
"""network module provides network management utils."""
import
os
from
pardus
import
iniutils
NET_PATH
=
"/etc/network"
NET_STACK
=
"baselayout"
INI
=
iniutils
.
iniParser
(
os
.
path
.
join
(
NET_PATH
,
script
()))
def
listProfiles
():
try
:
return
INI
.
listSections
()
except
iniutils
.
iniParserError
:
return
[]
class
Profile
:
def
__init__
(
self
,
name
):
self
.
name
=
name
try
:
self
.
info
=
INI
.
getSection
(
name
)
except
iniutils
.
iniParserError
:
self
.
info
=
{}
def
delete
(
self
):
INI
.
removeSection
(
self
.
name
)
def
save
(
self
,
no_notify
=
False
):
is_new
=
self
.
name
not
in
listProfiles
()
INI
.
setSection
(
self
.
name
,
self
.
info
)
if
no_notify
:
return
if
is_new
:
notify
(
"Network.Link"
,
"connectionChanged"
,
(
"added"
,
self
.
name
))
else
:
notify
(
"Network.Link"
,
"connectionChanged"
,
(
"changed"
,
self
.
name
))
class
AccessPoint
:
def
__init__
(
self
,
id
=
None
):
self
.
ssid
=
""
self
.
mode
=
""
self
.
mac
=
""
self
.
encryption
=
"none"
self
.
qual
=
""
self
.
protocol
=
""
self
.
channel
=
""
if
id
:
if
" ("
in
id
and
id
.
endswith
(
")"
):
self
.
ssid
,
rest
=
id
.
split
(
" ("
,
1
)
self
.
mode
,
self
.
mac
=
rest
.
split
(
" "
,
1
)
self
.
mac
=
self
.
mac
[:
-
1
]
else
:
self
.
ssid
=
id
def
id
(
self
):
d
=
{
"remote"
:
self
.
ssid
,
"mode"
:
self
.
mode
,
"mac"
:
self
.
mac
,
"encryption"
:
self
.
encryption
,
"quality"
:
self
.
qual
,
"protocol"
:
self
.
protocol
,
"channel"
:
self
.
channel
,
}
return
d
def
stopSameDevice
(
name
):
from
csl
import
setState
profile
=
Profile
(
name
)
device
=
profile
.
info
[
"device"
]
for
pn
in
listProfiles
():
if
pn
==
name
:
continue
pro
=
Profile
(
pn
)
if
pro
.
info
[
"device"
]
==
device
:
setState
(
pn
,
"down"
)
def
registerNameServers
(
profile
,
iface
):
name_mode
=
profile
.
info
.
get
(
"name_mode"
,
"default"
)
name_servers
=
[]
name_domain
=
""
if
name_mode
==
"auto"
:
for
server
in
iface
.
autoNameServers
():
name_servers
.
append
(
server
)
name_domain
=
iface
.
autoNameSearch
()
elif
name_mode
==
"custom"
:
for
server
in
profile
.
info
.
get
(
"name_server"
,
","
)
.
split
():
if
server
.
strip
():
name_servers
.
append
(
server
.
strip
())
elif
name_mode
==
"default"
:
name_servers
=
call
(
NET_STACK
,
"Network.Stack"
,
"getNameServers"
)
call
(
NET_STACK
,
"Network.Stack"
,
"registerNameServers"
,
(
iface
.
name
,
name_servers
,
name_domain
))
def
unregisterNameServers
(
iface
):
call
(
NET_STACK
,
"Network.Stack"
,
"unregisterNameServers"
,
(
iface
.
name
,
[],
""
))
api/comar/service.py
Dosyayı görüntüle @
32c2d57d
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
#
#
# Copyright (C) 2006-200
8
, TUBITAK/UEKAE
# Copyright (C) 2006-200
9
, TUBITAK/UEKAE
#
#
# This program is free software; you can redistribute it and/or modify it under
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# the terms of the GNU General Public License as published by the Free
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
# Please read the COPYING file.
# Please read the COPYING file.
#
#
"""service
utils
module provides service management utils."""
"""service module provides service management utils."""
import
os
import
os
...
...
api/comar/utility.py
Dosyayı görüntüle @
32c2d57d
#!/usr/bin/python
#!/usr/bin/python
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
#
#
# Copyright (C) 2006-200
8
, TUBITAK/UEKAE
# Copyright (C) 2006-200
9
, TUBITAK/UEKAE
#
#
# This program is free software; you can redistribute it and/or modify it
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# under the terms of the GNU General Public License as published by the
...
...
api/setup.py
Dosyayı görüntüle @
32c2d57d
...
@@ -16,7 +16,7 @@ import shutil
...
@@ -16,7 +16,7 @@ import shutil
from
distutils.core
import
setup
from
distutils.core
import
setup
from
distutils.command.install
import
install
from
distutils.command.install
import
install
version
=
"2.
1.3
"
version
=
"2.
3.0
"
distfiles
=
"""
distfiles
=
"""
setup.py
setup.py
...
...
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