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
02387318
Commit
02387318
authored
Oct 13, 2010
by
Devaev Maxim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New plugins type, named Customs
parent
9b0f78c4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
const.py
settingsd/const.py
+1
-0
server.py
settingsd/server.py
+4
-5
shared.py
settingsd/shared.py
+11
-0
No files found.
settingsd/const.py
View file @
02387318
...
@@ -8,6 +8,7 @@ VERSION = "0.1"
...
@@ -8,6 +8,7 @@ VERSION = "0.1"
FUNCTIONS_DIR
=
"functions"
FUNCTIONS_DIR
=
"functions"
ACTIONS_DIR
=
"actions"
ACTIONS_DIR
=
"actions"
CUSTOMS_DIR
=
"customs"
CONFIGS_DIR
=
"configs"
CONFIGS_DIR
=
"configs"
CONFIG_FILE_POSTFIX
=
".conf"
CONFIG_FILE_POSTFIX
=
".conf"
...
...
settingsd/server.py
View file @
02387318
...
@@ -40,10 +40,10 @@ class Server(object) :
...
@@ -40,10 +40,10 @@ class Server(object) :
###
###
def
loadModules
(
self
)
:
def
loadModules
(
self
)
:
sys
.
path
.
append
(
const
.
FUNCTIONS_DIR
)
for
modules_path_list_item
in
(
const
.
FUNCTIONS_DIR
,
const
.
ACTIONS_DIR
,
const
.
CUSTOMS_DIR
)
:
sys
.
path
.
append
(
const
.
ACTIONS_DIR
)
logger
.
debug
(
"Processing directory
\"
%
s
\"
..."
%
(
modules_path_list_item
))
sys
.
path
.
append
(
modules_path_list_item
)
for
modules_path_list_item
in
(
const
.
FUNCTIONS_DIR
,
const
.
ACTIONS_DIR
)
:
for
module_name
in
[
item
[:
-
3
]
for
item
in
os
.
listdir
(
modules_path_list_item
)
if
item
.
endswith
(
".py"
)
]
:
for
module_name
in
[
item
[:
-
3
]
for
item
in
os
.
listdir
(
modules_path_list_item
)
if
item
.
endswith
(
".py"
)
]
:
try
:
try
:
self
.
_modules_list
.
append
(
__import__
(
module_name
,
globals
(),
locals
(),
[
""
]))
self
.
_modules_list
.
append
(
__import__
(
module_name
,
globals
(),
locals
(),
[
""
]))
...
@@ -59,8 +59,7 @@ class Server(object) :
...
@@ -59,8 +59,7 @@ class Server(object) :
logger
.
verbose
(
"Loaded module:
%
s"
%
(
module_name
))
logger
.
verbose
(
"Loaded module:
%
s"
%
(
module_name
))
sys
.
path
.
remove
(
const
.
FUNCTIONS_DIR
)
sys
.
path
.
remove
(
modules_path_list_item
)
sys
.
path
.
remove
(
const
.
ACTIONS_DIR
)
###
###
...
...
settingsd/shared.py
View file @
02387318
...
@@ -129,3 +129,14 @@ class Actions(object) :
...
@@ -129,3 +129,14 @@ class Actions(object) :
@classmethod
@classmethod
def
name
(
self
)
:
def
name
(
self
)
:
return
"Actions"
return
"Actions"
class
Customs
(
object
)
:
__metaclass__
=
SharedRootMeta
### Public ###
@classmethod
def
name
(
self
)
:
return
"Customs"
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