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
cd723b32
Kaydet (Commit)
cd723b32
authored
Mar 20, 2009
tarafından
Fatih Aşıcı
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
refactor a little
üst
373aa10e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
33 deletions
+29
-33
config.py
zorg/zorg/config.py
+12
-19
consts.py
zorg/zorg/consts.py
+11
-8
hwdata.py
zorg/zorg/hwdata.py
+2
-2
probe.py
zorg/zorg/probe.py
+4
-4
No files found.
zorg/zorg/config.py
Dosyayı görüntüle @
cd723b32
...
...
@@ -117,11 +117,10 @@ def addTag(p, name, data):
t
.
insertData
(
data
)
def
getDeviceInfo
(
busId
):
configFile
=
os
.
path
.
join
(
zorgConfigDir
,
zorgConfig
)
if
not
os
.
path
.
exists
(
configFile
):
if
not
os
.
path
.
exists
(
config_file
):
return
doc
=
piksemel
.
parse
(
config
F
ile
)
doc
=
piksemel
.
parse
(
config
_f
ile
)
cardTag
=
None
for
tag
in
doc
.
tags
(
"Card"
):
...
...
@@ -206,13 +205,11 @@ def getDeviceInfo(busId):
return
device
def
saveDeviceInfo
(
card
):
if
not
os
.
path
.
exists
(
zorgConfigDir
):
os
.
mkdir
(
zorgConfigDir
,
0755
)
configFile
=
os
.
path
.
join
(
zorgConfigDir
,
zorgConfig
)
if
not
os
.
path
.
exists
(
config_dir
):
os
.
mkdir
(
config_dir
,
0755
)
try
:
doc
=
piksemel
.
parse
(
config
F
ile
)
doc
=
piksemel
.
parse
(
config
_f
ile
)
except
OSError
:
doc
=
piksemel
.
newDocument
(
"ZORG"
)
...
...
@@ -278,20 +275,18 @@ def saveDeviceInfo(card):
if
card
.
monitors
.
has_key
(
outName
):
addMonitor
(
outName
,
"SecondMonitor"
)
f
=
open
(
config
F
ile
,
"w"
)
f
=
open
(
config
_f
ile
,
"w"
)
f
.
write
(
doc
.
toPrettyString
()
.
replace
(
"
\n\n
"
,
""
))
f
=
open
(
os
.
path
.
join
(
zorgConfigDir
,
"configured_card"
)
,
"w"
)
f
=
open
(
configured_bus_file
,
"w"
)
f
.
write
(
info
[
"bus-id"
])
def
getKeymap
():
layout
=
None
variant
=
"basic"
configFile
=
os
.
path
.
join
(
zorgConfigDir
,
zorgConfig
)
try
:
doc
=
piksemel
.
parse
(
config
F
ile
)
doc
=
piksemel
.
parse
(
config
_f
ile
)
keyboard
=
doc
.
getTag
(
"Keyboard"
)
if
keyboard
:
...
...
@@ -324,13 +319,11 @@ def getKeymap():
return
layout
,
variant
def
saveKeymap
(
layout
,
variant
=
"basic"
):
if
not
os
.
path
.
exists
(
zorgConfigDir
):
os
.
mkdir
(
zorgConfigDir
,
0755
)
configFile
=
os
.
path
.
join
(
zorgConfigDir
,
zorgConfig
)
if
not
os
.
path
.
exists
(
config_dir
):
os
.
mkdir
(
config_dir
,
0755
)
try
:
doc
=
piksemel
.
parse
(
config
F
ile
)
doc
=
piksemel
.
parse
(
config
_f
ile
)
except
OSError
:
doc
=
piksemel
.
newDocument
(
"ZORG"
)
...
...
@@ -343,4 +336,4 @@ def saveKeymap(layout, variant="basic"):
keyboardTag
.
insertTag
(
"Layout"
)
.
insertData
(
layout
)
keyboardTag
.
insertTag
(
"Variant"
)
.
insertData
(
variant
)
file
(
config
F
ile
,
"w"
)
.
write
(
doc
.
toPrettyString
()
.
replace
(
"
\n\n
"
,
""
))
file
(
config
_f
ile
,
"w"
)
.
write
(
doc
.
toPrettyString
()
.
replace
(
"
\n\n
"
,
""
))
zorg/zorg/consts.py
Dosyayı görüntüle @
cd723b32
#!/usr/bin/python
# -*- coding: utf-8 -*-
xorgConf
=
"/etc/X11/xorg.conf"
zorgConfigDir
=
"/var/lib/zorg"
zorgConfig
=
"config.xml"
zorgDataDir
=
"/usr/share/zorg"
from
os.path
import
join
DriversDB
=
"
%
s/DriversDB"
%
zorgDataDir
MonitorsDB
=
"
%
s/MonitorsDB"
%
zorgDataDir
config_dir
=
"/var/lib/zorg"
data_dir
=
"/usr/share/X11"
modules_dir
=
"/usr/lib/xorg/modules"
driver_path
=
"/usr/lib/xorg/modules/drivers"
xkb_path
=
"/usr/share/X11/xkb/symbols"
xorg_conf_file
=
"/etc/X11/xorg.conf"
config_file
=
join
(
config_dir
,
"config.xml"
)
configured_bus_file
=
join
(
config_dir
,
"configured_bus"
)
drivers_file
=
join
(
data_dir
,
"DriversDB"
)
monitors_file
=
join
(
data_dir
,
"MonitorsDB"
)
xkb_symbols_dir
=
join
(
data_dir
,
"xkb/symbols"
)
drivers_dir
=
join
(
modules_dir
,
"drivers"
)
sysdir
=
"/sys/bus/pci/devices/"
...
...
zorg/zorg/hwdata.py
Dosyayı görüntüle @
cd723b32
...
...
@@ -69,7 +69,7 @@ drivers = {
def
getCompatibleDriverNames
(
vendor_id
,
product_id
):
pci_id
=
vendor_id
+
product_id
drvlist
=
[]
for
line
in
loadFile
(
DriversDB
):
for
line
in
loadFile
(
drivers_file
):
if
line
.
startswith
(
pci_id
):
drvlist
=
line
.
rstrip
(
"
\n
"
)
.
split
(
" "
)[
1
:]
break
...
...
@@ -107,7 +107,7 @@ def getMonitorInfos():
vendorList
=
{}
vendor
=
[]
for
line
in
loadFile
(
MonitorsDB
):
for
line
in
loadFile
(
monitors_file
):
monitor
=
line
.
split
(
";"
)
if
len
(
monitor
)
==
5
:
...
...
zorg/zorg/probe.py
Dosyayı görüntüle @
cd723b32
...
...
@@ -99,7 +99,7 @@ class VideoDevice:
self
.
driver
=
"fbdev"
return
for
line
in
loadFile
(
DriversDB
):
for
line
in
loadFile
(
drivers_file
):
if
line
.
startswith
(
self
.
vendor_id
+
self
.
product_id
):
print
"Device ID found in driver database."
...
...
@@ -231,12 +231,12 @@ def call(package, model, method, *args):
return
cmethod
(
timeout
=
2
**
16
-
1
,
*
args
)
def
getKeymapList
():
return
os
.
listdir
(
xkb_
path
)
return
os
.
listdir
(
xkb_
symbols_dir
)
def
driverExists
(
name
):
return
os
.
path
.
exists
(
os
.
path
.
join
(
driver
_path
,
"
%
s_drv.so"
%
name
))
return
os
.
path
.
exists
(
os
.
path
.
join
(
driver
s_dir
,
"
%
s_drv.so"
%
name
))
def
listAvailableDrivers
(
d
=
driver
_path
):
def
listAvailableDrivers
(
d
=
driver
s_dir
):
a
=
[]
if
os
.
path
.
exists
(
d
):
for
drv
in
os
.
listdir
(
d
):
...
...
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