ScolaSync
5.1
globaldef.py
Aller à la documentation de ce fichier.
1
#!/usr/bin/python
2
# $Id: globaldef.py 47 2011-06-13 10:20:14Z georgesk $
3
4
#globaldef.py is part of the package scolasync. This module contains
5
#some definitions which can be reused globally in the application
6
#
7
8
9
licenceEn=
"""
10
scolasync version %s:
11
12
a program to manage file transfers between a computer and a collection
13
of USB sticks.
14
15
Copyright (C) 2010 Georges Khaznadar <georgesk@ofset.org>
16
17
This program is free software: you can redistribute it and/or modify
18
it under the terms of the GNU General Public License as published by
19
the Free Software Foundation, either version 3 of the License, or
20
(at your option) any later version.
21
22
This program is distributed in the hope that it will be useful,
23
but WITHOUT ANY WARRANTY; without even the implied warranty of
24
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
GNU General Public License for more details.
26
27
You should have received a copy of the GNU General Public License
28
along with this program. If not, see <http://www.gnu.org/licenses/>.
29
"""
30
31
import
platform, os
32
33
if
platform.system()==
"Linux"
:
34
userShareDir=
"~/.scolasync"
35
logFileName=
"~/.scolasync/scolasync.log"
36
markFileName=
"~/.scolasync/marques.py"
37
elif
platform.system()==
"Windows"
:
38
# to be implemented
39
userShareDir=
"??"
40
logFileName=
"??"
41
markFileName=
"??"
42
43
46
47
def
firstdir
(l):
48
for
d
in
l:
49
if
os.path.isdir(d):
return
d
50
return
None
51
52
57
58
def
_dir(which):
59
if
which==
"lang"
:
60
return
firstdir
([
"/usr/share/scolasync/lang"
,
"lang"
])
61
elif
which==
"help"
:
62
return
firstdir
([
"/usr/share/scolasync/help"
,
"help"
])
63
elif
which==
"share"
:
64
return
firstdir
([
"/usr/share/scolasync/"
,
"share"
])
65
return
None
66
src.globaldef.firstdir
def firstdir(l)
Renvoie le premier répertoire existant d'une liste de propositions.
Definition:
globaldef.py:47
src
globaldef.py
Généré par
1.8.17