Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
settingsd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
settingsd
Commits
2d272b44
Commit
2d272b44
authored
Feb 08, 2011
by
Devaev Maxim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace over re.sub
parent
c89e1a49
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
fmod_local_groups.py
plugins/functions/fmod_local_groups.py
+2
-2
fmod_local_users.py
plugins/functions/fmod_local_users.py
+2
-2
fmod_nss_roles.py
plugins/functions/fmod_nss_roles.py
+2
-2
fmod_system_services.py
plugins/functions/fmod_system_services.py
+2
-2
No files found.
plugins/functions/fmod_local_groups.py
View file @
2d272b44
...
...
@@ -167,7 +167,7 @@ class Service(service.Service, pyinotify.ThreadedNotifier) :
local_groups_shared
=
shared
.
Functions
.
shared
(
LOCAL_GROUPS_SHARED_NAME
)
group_count
=
0
for
group_name
in
self
.
localGroups
()
:
dbus_group_name
=
group_name
.
replace
(
"-"
,
"_"
)
dbus_group_name
=
re
.
sub
(
r"[^\w\d_]"
,
"_"
,
group_name
)
local_groups_shared
.
addSharedObject
(
dbus_group_name
,
LocalGroup
(
group_name
,
tools
.
dbus
.
joinPath
(
SERVICE_NAME
,
dbus_group_name
),
self
))
group_count
+=
1
...
...
@@ -211,7 +211,7 @@ class Service(service.Service, pyinotify.ThreadedNotifier) :
return
group_names_list
=
self
.
localGroups
()
dbus_group_names_list
=
[
item
.
replace
(
"-"
,
"_"
)
for
item
in
group_names_list
]
dbus_group_names_list
=
[
re
.
sub
(
r"[^\w\d_]"
,
"_"
,
item
)
for
item
in
group_names_list
]
local_groups_shared
=
shared
.
Functions
.
shared
(
LOCAL_GROUPS_SHARED_NAME
)
...
...
plugins/functions/fmod_local_users.py
View file @
2d272b44
...
...
@@ -228,7 +228,7 @@ class Service(service.Service, pyinotify.ThreadedNotifier) :
local_users_shared
=
shared
.
Functions
.
shared
(
LOCAL_USERS_SHARED_NAME
)
user_count
=
0
for
user_name
in
self
.
localUsers
()
:
dbus_user_name
=
user_name
.
replace
(
"-"
,
"_"
)
dbus_user_name
=
re
.
sub
(
r"[^\w\d_]"
,
"_"
,
user_name
)
local_users_shared
.
addSharedObject
(
dbus_user_name
,
LocalUser
(
user_name
,
tools
.
dbus
.
joinPath
(
SERVICE_NAME
,
dbus_user_name
),
self
))
user_count
+=
1
...
...
@@ -272,7 +272,7 @@ class Service(service.Service, pyinotify.ThreadedNotifier) :
return
user_names_list
=
self
.
localUsers
()
dbus_user_names_list
=
[
item
.
replace
(
"-"
,
"_"
)
for
item
in
user_names_list
]
dbus_user_names_list
=
[
re
.
sub
(
r"[^\w\d_]"
,
"_"
,
item
)
for
item
in
user_names_list
]
local_users_shared
=
shared
.
Functions
.
shared
(
LOCAL_USERS_SHARED_NAME
)
...
...
plugins/functions/fmod_nss_roles.py
View file @
2d272b44
...
...
@@ -220,7 +220,7 @@ class Service(service.Service, pyinotify.ThreadedNotifier) :
nss_roles_shared
=
shared
.
Functions
.
shared
(
NSS_ROLES_SHARED_NAME
)
role_count
=
0
for
role_name
in
self
.
nssRoles
()
:
dbus_role_name
=
r
ole_name
.
replace
(
"-"
,
"_"
)
dbus_role_name
=
r
e
.
sub
(
r"[^\w\d_]"
,
"_"
,
role_name
)
nss_roles_shared
.
addSharedObject
(
dbus_role_name
,
NssRole
(
role_name
,
tools
.
dbus
.
joinPath
(
SERVICE_NAME
,
dbus_role_name
),
self
))
role_count
+=
1
...
...
@@ -261,7 +261,7 @@ class Service(service.Service, pyinotify.ThreadedNotifier) :
return
role_names_list
=
self
.
nssRoles
()
dbus_role_names_list
=
[
item
.
replace
(
"-"
,
"_"
)
for
item
in
role_names_list
]
dbus_role_names_list
=
[
re
.
sub
(
r"[^\w\d_]"
,
"_"
,
item
)
for
item
in
role_names_list
]
nss_roles_shared
=
shared
.
Functions
.
shared
(
NSS_ROLES_SHARED_NAME
)
...
...
plugins/functions/fmod_system_services.py
View file @
2d272b44
...
...
@@ -159,7 +159,7 @@ class Service(service.Service, pyinotify.ThreadedNotifier) :
for
system_service_name
in
os
.
listdir
(
initd_dir_path
)
:
st_mode
=
os
.
stat
(
os
.
path
.
join
(
initd_dir_path
,
system_service_name
))
.
st_mode
if
st_mode
&
stat
.
S_IEXEC
and
st_mode
&
stat
.
S_IFREG
:
dbus_system_service_name
=
re
.
sub
(
r"
-|\.
"
,
"_"
,
system_service_name
)
dbus_system_service_name
=
re
.
sub
(
r"
[^\w\d_]
"
,
"_"
,
system_service_name
)
system_services_shared
.
addSharedObject
(
dbus_system_service_name
,
SystemService
(
system_service_name
,
tools
.
dbus
.
joinPath
(
SERVICE_NAME
,
dbus_system_service_name
),
self
))
...
...
@@ -199,7 +199,7 @@ class Service(service.Service, pyinotify.ThreadedNotifier) :
if
event
.
dir
:
return
dbus_system_service_name
=
re
.
sub
(
r"
-|\.
"
,
"_"
,
event
.
name
)
dbus_system_service_name
=
re
.
sub
(
r"
[^\w\d_]
"
,
"_"
,
event
.
name
)
system_services_shared
=
shared
.
Functions
.
shared
(
SERVICE_NAME
)
if
event
.
maskname
==
"IN_CREATE"
:
...
...
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