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
a521bd57
Kaydet (Commit)
a521bd57
authored
Mar 20, 2009
tarafından
Fatih Aşıcı
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
refactor #2
üst
cd723b32
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
36 deletions
+37
-36
config.py
zorg/zorg/config.py
+21
-20
consts.py
zorg/zorg/consts.py
+0
-2
hwdata.py
zorg/zorg/hwdata.py
+5
-5
probe.py
zorg/zorg/probe.py
+11
-9
No files found.
zorg/zorg/config.py
Dosyayı görüntüle @
a521bd57
...
...
@@ -4,7 +4,7 @@ import os
import
piksemel
from
zorg
.consts
import
*
from
zorg
import
consts
from
zorg.parser
import
*
from
zorg.probe
import
VideoDevice
,
Monitor
from
zorg.utils
import
*
...
...
@@ -12,11 +12,11 @@ from zorg.utils import *
def
saveXorgConfig
(
card
):
parser
=
XorgParser
()
secModule
=
XorgSection
(
"Module"
)
secFlags
=
XorgSection
(
"ServerFlags"
)
secDevice
=
XorgSection
(
"Device"
)
secScr
=
XorgSection
(
"Screen"
)
secLay
=
XorgSection
(
"ServerLayout"
)
secModule
=
XorgSection
(
"Module"
)
secFlags
=
XorgSection
(
"ServerFlags"
)
secDevice
=
XorgSection
(
"Device"
)
secScr
=
XorgSection
(
"Screen"
)
secLay
=
XorgSection
(
"ServerLayout"
)
parser
.
sections
=
[
secModule
,
...
...
@@ -106,9 +106,9 @@ def saveXorgConfig(card):
secLay
.
set
(
"Identifier"
,
"Layout"
)
secLay
.
set
(
"Screen"
,
"Screen"
)
backup
(
xorgConf
)
backup
(
consts
.
xorg_conf_file
)
f
=
open
(
xorgConf
,
"w"
)
f
=
open
(
consts
.
xorg_conf_file
,
"w"
)
f
.
write
(
parser
.
toString
())
f
.
close
()
...
...
@@ -117,10 +117,10 @@ def addTag(p, name, data):
t
.
insertData
(
data
)
def
getDeviceInfo
(
busId
):
if
not
os
.
path
.
exists
(
config_file
):
if
not
os
.
path
.
exists
(
con
sts
.
con
fig_file
):
return
doc
=
piksemel
.
parse
(
config_file
)
doc
=
piksemel
.
parse
(
con
sts
.
con
fig_file
)
cardTag
=
None
for
tag
in
doc
.
tags
(
"Card"
):
...
...
@@ -205,11 +205,11 @@ def getDeviceInfo(busId):
return
device
def
saveDeviceInfo
(
card
):
if
not
os
.
path
.
exists
(
config_dir
):
os
.
mkdir
(
config_dir
,
0755
)
if
not
os
.
path
.
exists
(
con
sts
.
con
fig_dir
):
os
.
mkdir
(
con
sts
.
con
fig_dir
,
0755
)
try
:
doc
=
piksemel
.
parse
(
config_file
)
doc
=
piksemel
.
parse
(
con
sts
.
con
fig_file
)
except
OSError
:
doc
=
piksemel
.
newDocument
(
"ZORG"
)
...
...
@@ -275,10 +275,10 @@ def saveDeviceInfo(card):
if
card
.
monitors
.
has_key
(
outName
):
addMonitor
(
outName
,
"SecondMonitor"
)
f
=
open
(
config_file
,
"w"
)
f
=
open
(
con
sts
.
con
fig_file
,
"w"
)
f
.
write
(
doc
.
toPrettyString
()
.
replace
(
"
\n\n
"
,
""
))
f
=
open
(
configured_bus_file
,
"w"
)
f
=
open
(
con
sts
.
con
figured_bus_file
,
"w"
)
f
.
write
(
info
[
"bus-id"
])
def
getKeymap
():
...
...
@@ -286,7 +286,7 @@ def getKeymap():
variant
=
"basic"
try
:
doc
=
piksemel
.
parse
(
config_file
)
doc
=
piksemel
.
parse
(
con
sts
.
con
fig_file
)
keyboard
=
doc
.
getTag
(
"Keyboard"
)
if
keyboard
:
...
...
@@ -319,11 +319,11 @@ def getKeymap():
return
layout
,
variant
def
saveKeymap
(
layout
,
variant
=
"basic"
):
if
not
os
.
path
.
exists
(
config_dir
):
os
.
mkdir
(
config_dir
,
0755
)
if
not
os
.
path
.
exists
(
con
sts
.
con
fig_dir
):
os
.
mkdir
(
con
sts
.
con
fig_dir
,
0755
)
try
:
doc
=
piksemel
.
parse
(
config_file
)
doc
=
piksemel
.
parse
(
con
sts
.
con
fig_file
)
except
OSError
:
doc
=
piksemel
.
newDocument
(
"ZORG"
)
...
...
@@ -336,4 +336,5 @@ def saveKeymap(layout, variant="basic"):
keyboardTag
.
insertTag
(
"Layout"
)
.
insertData
(
layout
)
keyboardTag
.
insertTag
(
"Variant"
)
.
insertData
(
variant
)
file
(
config_file
,
"w"
)
.
write
(
doc
.
toPrettyString
()
.
replace
(
"
\n\n
"
,
""
))
f
=
file
(
consts
.
config_file
,
"w"
)
f
.
write
(
doc
.
toPrettyString
()
.
replace
(
"
\n\n
"
,
""
))
zorg/zorg/consts.py
Dosyayı görüntüle @
a521bd57
...
...
@@ -15,6 +15,4 @@ 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/"
package_sep
=
"/"
zorg/zorg/hwdata.py
Dosyayı görüntüle @
a521bd57
# -*- coding: utf-8 -*-
import
zorg.probe
from
zorg
.consts
import
*
from
zorg
import
consts
from
zorg.utils
import
*
drivers
=
{
...
...
@@ -69,7 +69,7 @@ drivers = {
def
getCompatibleDriverNames
(
vendor_id
,
product_id
):
pci_id
=
vendor_id
+
product_id
drvlist
=
[]
for
line
in
loadFile
(
drivers_file
):
for
line
in
loadFile
(
consts
.
drivers_file
):
if
line
.
startswith
(
pci_id
):
drvlist
=
line
.
rstrip
(
"
\n
"
)
.
split
(
" "
)[
1
:]
break
...
...
@@ -88,14 +88,14 @@ def getAvailableDriverNames():
availableDrivers
=
zorg
.
probe
.
listAvailableDrivers
()
availablePackages
=
zorg
.
probe
.
listDriverPackages
()
packages
=
[
x
.
split
(
package_sep
)
for
x
in
drivers
.
keys
()
if
package_sep
in
x
]
packages
=
[
x
.
split
(
consts
.
package_sep
)
for
x
in
drivers
.
keys
()
if
consts
.
package_sep
in
x
]
for
d
in
availableDrivers
:
drvlist
.
append
(
d
)
for
drv
,
pkg
in
packages
:
if
pkg
.
replace
(
"-"
,
"_"
)
in
availablePackages
:
d
=
drv
+
package_sep
+
pkg
d
=
drv
+
consts
.
package_sep
+
pkg
drvlist
.
append
(
d
)
if
drv
in
drvlist
:
drvlist
.
remove
(
drv
)
...
...
@@ -107,7 +107,7 @@ def getMonitorInfos():
vendorList
=
{}
vendor
=
[]
for
line
in
loadFile
(
monitors_file
):
for
line
in
loadFile
(
consts
.
monitors_file
):
monitor
=
line
.
split
(
";"
)
if
len
(
monitor
)
==
5
:
...
...
zorg/zorg/probe.py
Dosyayı görüntüle @
a521bd57
...
...
@@ -6,10 +6,12 @@ import glob
import
struct
import
fnmatch
from
zorg
.consts
import
*
from
zorg
import
consts
from
zorg.parser
import
*
from
zorg.utils
import
*
sysdir
=
"/sys/bus/pci/devices/"
# from pci/header.h
PCI_COMMAND
=
0x04
PCI_COMMAND_IO
=
0x1
...
...
@@ -99,15 +101,15 @@ class VideoDevice:
self
.
driver
=
"fbdev"
return
for
line
in
loadFile
(
drivers_file
):
for
line
in
loadFile
(
consts
.
drivers_file
):
if
line
.
startswith
(
self
.
vendor_id
+
self
.
product_id
):
print
"Device ID found in driver database."
driverlist
=
line
.
rstrip
(
"
\n
"
)
.
split
(
" "
)[
1
:]
for
drv
in
driverlist
:
if
package_sep
in
drv
:
drvname
,
drvpackage
=
drv
.
split
(
package_sep
,
1
)
if
consts
.
package_sep
in
drv
:
drvname
,
drvpackage
=
drv
.
split
(
consts
.
package_sep
,
1
)
if
drvpackage
.
replace
(
"-"
,
"_"
)
in
self
.
_driverPackages
():
self
.
driver
=
drvname
self
.
package
=
drvpackage
...
...
@@ -140,8 +142,8 @@ class VideoDevice:
self
.
package
=
None
if
withDriver
:
if
package_sep
in
withDriver
:
drvname
,
drvpackage
=
withDriver
.
split
(
package_sep
,
1
)
if
consts
.
package_sep
in
withDriver
:
drvname
,
drvpackage
=
withDriver
.
split
(
consts
.
package_sep
,
1
)
if
drvpackage
.
replace
(
"-"
,
"_"
)
in
self
.
_driverPackages
():
self
.
driver
=
drvname
self
.
package
=
drvpackage
...
...
@@ -231,12 +233,12 @@ def call(package, model, method, *args):
return
cmethod
(
timeout
=
2
**
16
-
1
,
*
args
)
def
getKeymapList
():
return
os
.
listdir
(
xkb_symbols_dir
)
return
os
.
listdir
(
consts
.
xkb_symbols_dir
)
def
driverExists
(
name
):
return
os
.
path
.
exists
(
os
.
path
.
join
(
drivers_dir
,
"
%
s_drv.so"
%
name
))
return
os
.
path
.
exists
(
os
.
path
.
join
(
consts
.
drivers_dir
,
"
%
s_drv.so"
%
name
))
def
listAvailableDrivers
(
d
=
drivers_dir
):
def
listAvailableDrivers
(
d
=
consts
.
drivers_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