Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
agkyra
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
itminedu
agkyra
Commits
5962b339
Commit
5962b339
authored
9 years ago
by
Giorgos Korfiatis
Browse files
Options
Downloads
Patches
Plain Diff
Read default settings from resources/defaults.conf
parent
c70f1e10
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
agkyra.spec
+1
-0
1 addition, 0 deletions
agkyra.spec
agkyra/config.py
+19
-23
19 additions, 23 deletions
agkyra/config.py
agkyra/resources/defaults.conf
+24
-0
24 additions, 0 deletions
agkyra/resources/defaults.conf
with
44 additions
and
23 deletions
agkyra.spec
+
1
−
0
View file @
5962b339
...
...
@@ -41,6 +41,7 @@ a.datas += extra_datas(os.path.join(HERE, 'agkyra'), os.path.join('resources', '
a
.
datas
+=
extra_datas
(
os
.
path
.
join
(
HERE
,
'
agkyra
'
),
os
.
path
.
join
(
'
resources
'
,
'
nwgui
'
))
a
.
datas
+=
extra_datas
(
os
.
path
.
join
(
HERE
,
'
agkyra
'
),
os
.
path
.
join
(
'
resources
'
,
'
ui_data
'
))
a
.
datas
+=
extra_datas
(
os
.
path
.
join
(
HERE
,
'
agkyra
'
),
os
.
path
.
join
(
'
resources
'
,
'
cacert.pem
'
))
a
.
datas
+=
extra_datas
(
os
.
path
.
join
(
HERE
,
'
agkyra
'
),
os
.
path
.
join
(
'
resources
'
,
'
defaults.conf
'
))
pyz
=
PYZ
(
a
.
pure
)
exe
=
EXE
(
pyz
,
...
...
This diff is collapsed.
Click to expand it.
agkyra/config.py
+
19
−
23
View file @
5962b339
...
...
@@ -28,6 +28,8 @@ The operations of a sync are similar to the operations of a cloud, as they are
implemented in kamaki.cli.config
"""
import
os
import
sys
import
imp
import
stat
from
re
import
match
from
ConfigParser
import
Error
...
...
@@ -57,30 +59,24 @@ config.CONFIG_PATH = CONFIG_PATH
config
.
CONFIG_ENV
=
''
SYNC_PREFIX
=
'
sync
'
if
getattr
(
sys
,
'
frozen
'
,
False
):
# we are running in a |PyInstaller| bundle
BASEDIR
=
sys
.
_MEIPASS
else
:
# we are running in a normal Python environment
BASEDIR
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
RESOURCES
=
os
.
path
.
join
(
BASEDIR
,
'
resources
'
)
defaults_file
=
os
.
path
.
join
(
RESOURCES
,
'
defaults.conf
'
)
imp
.
load_source
(
'
default_settings
'
,
defaults_file
)
from
default_settings
import
DEFAULT_GLOBAL
,
DEFAULT_CLOUDS
,
DEFAULT_SYNCS
DEFAULT_GLOBAL
[
'
agkyra_dir
'
]
=
AGKYRA_DIR
config
.
DEFAULTS
=
{
'
global
'
:
{
'
agkyra_dir
'
:
AGKYRA_DIR
,
'
sync_on_start
'
:
'
on
'
,
'
language
'
:
'
en
'
},
CLOUD_PREFIX
:
{
# <cloud>: {
# 'url': '',
# 'token': '',
# 'ignore_ssl': True or False overwrites ca_certs,
# 'ca_certs': /path/to/ca/certificate/buddle
# whatever else may be useful in this context
# },
# ... more clouds
},
SYNC_PREFIX
:
{
# <sync>: {
# 'cloud': '',
# 'container': '',
# 'directory': ''
# },
# ... more syncs
},
'
global
'
:
DEFAULT_GLOBAL
,
CLOUD_PREFIX
:
DEFAULT_CLOUDS
,
SYNC_PREFIX
:
DEFAULT_SYNCS
,
}
...
...
This diff is collapsed.
Click to expand it.
agkyra/resources/defaults.conf
0 → 100644
+
24
−
0
View file @
5962b339
DEFAULT_GLOBAL
= {
"sync_on_start"
:
"on"
,
"language"
:
"en"
}
DEFAULT_CLOUDS
= {
# <cloud>: {
# "url": "",
# "token": "",
# "ignore_ssl": True or False overwrites ca_certs,
# "ca_certs": /path/to/ca/certificate/buddle
# whatever else may be useful in this context
# },
# ... more clouds
}
DEFAULT_SYNCS
= {
# <sync>: {
# "cloud": "",
# "container": "",
# "directory": ""
# },
# ... more syncs
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment