0: return filtered[0]
else: return None
-
+
def has_props(self):
return len(self.props) != 0
def has_prop(self, name):
@@ -479,7 +479,7 @@ TF_ENCODING = 'encoding' # encoding par défaut du fichier
class TextFile(TasksFile):
"""Fichier de tâches au format texte.
"""
-
+
TASKS_TXT = ['TASKS.txt', 'tasks.txt']
PURGED_TXT = ['PURGED.txt', 'purged.txt']
FILENAMES = [TASKS_TXT, PURGED_TXT]
@@ -491,7 +491,7 @@ class TextFile(TasksFile):
tasks = None
props = None
-
+
def __init__(self, src=None, filetype=TASKS_FILETYPE, raise_exception=False):
self.tasks = []
self.props = {}
@@ -591,12 +591,12 @@ class TextFile(TasksFile):
def get_file(self):
return self.pf
-
+
def get_lastid(self):
return int(self.get_prop(TF_LASTID, 0))
def set_lastid(self, lastid):
self.set_prop(TF_LASTID, int(lastid))
-
+
class TWFile(TasksFile):
"""Fichier de tâches au format TiddlyWiki
"""
@@ -607,11 +607,11 @@ class TWFile(TasksFile):
twfile = None
tasks = None
props = None
-
+
def __init__(self, src=None, raise_exception=False):
self.tasks = []
self.props = {}
-
+
if src is None:
twfile = TiddlyWiki(src, raise_exception=False)
if twfile.is_valid():
@@ -630,14 +630,14 @@ class TWFile(TasksFile):
self.valid = False
# XXX continuer ici
twfile = TiddlyWiki(src, raise_exception=False)
-
+
def save(self, file=None, raise_exception=True):
pass
class ProxyTask:
__task = None
index = None
-
+
def __init__(self, task, index):
self.__task = task
self.index = index
@@ -648,7 +648,7 @@ class ProxyTask:
class FileAggregate(TasksFile):
__tfs = None
-
+
def __init__(self, tfs):
self.__tfs = []
for tf in tfs:
@@ -691,7 +691,7 @@ class FileAggregate(TasksFile):
filtered.append(ProxyTask(t, t.index + offset))
offset += len(tf)
return filtered
-
+
def has_props(self):
for tf in self.__tfs:
if tf.has_props(): return True
@@ -712,7 +712,7 @@ class FileAggregate(TasksFile):
raise NotImplementedError
def set_lastid(self, lastid):
raise NotImplementedError
-
+
def is_valid(self):
raise NotImplementedError
@@ -853,7 +853,7 @@ class TasksCLI:
if purgedfile is not None: purgedfile = TextFile(purgedfile)
else: purgedfile = TextFile(self.tasksrc.get_purgedsrc(), TextFile.PURGED_FILETYPE)
self.purgedfile = purgedfile
- return self.purgedfile
+ return self.purgedfile
def __init__(self, tasksrc=None):
if not isinstance(tasksrc, TasksrcFile):
@@ -862,7 +862,7 @@ class TasksCLI:
CONFOPT = 'c:'
CONFLOPT = ['config=', 'tasksdir=', 'projdirs=', 'tasksfile=', 'purgedfile=']
-
+
def is_global_option(self, opt, value):
if opt in ('-c', '--config'):
self.tasksrc = TasksrcFile(value)
@@ -914,7 +914,7 @@ class TasksCLI:
pd = path.join(projdir, p)
if path.isdir(pd): return pd
return None
-
+
def get_project(self):
"""Retourner le nom du projet si on est dans un répertoire de projet, None sinon
"""
@@ -953,7 +953,7 @@ class TasksCLI:
"""
tfs = {}
def get_tf(p):
-
+
tf = tfs.get(p, None)
if tf is None:
tf = self.get_tf(p)
@@ -978,7 +978,7 @@ class TasksCLI:
add_or_update = norm_seq(add_or_update)
delete_projects = norm_seq(delete_projects)
delete_ids = norm_seq(delete_ids)
-
+
if delete:
for t in delete:
for p in t.get_projects():
@@ -1061,7 +1061,7 @@ class TasksCLI:
def __cvs_commit(self, t, argv=()):
pass
-
+
############################################################################
def ADD(self,
@@ -1145,7 +1145,7 @@ OPTIONS
if not t.has_projects():
project = self.get_project()
if project is not None: t.add_project(project)
-
+
if newtask: tf.add(t)
tf.save()
self.update_projects(add_or_update=t)
@@ -1208,7 +1208,7 @@ OPTIONS
if infos: infos = u" [%s]" % u", ".join(infos)
else: infos = u""
enote(u"%i / %i tâche(s) trouvée(s)%s" % (numtodos, len(tasks), infos))
-
+
def LIST(self,
listall_option=False, listpurged_option=False, showdesc_option=False, showstats_option=True,
indexes=None, patterns=None, contexts=None, projects=None, props=None,
@@ -1305,7 +1305,7 @@ EDIT: ----------------------------------------------------------------"""
PROJECTS_PATTERN = re.compile(r'##\s*projects:\s*')
PROJ_PATTERN = re.compile(r'(\S+)\s*')
PROP_PATTERN = re.compile(r'##\s*(\S+)\s*=\s*(\S+)')
-
+
def __nblines(self, s):
lines = s.split("\n")
nblines = len(lines)
@@ -1349,15 +1349,15 @@ USAGE
for name, value in t.items():
template += u"## %s=%s\n" % (name, value)
template += u"\n"
-
+
title = t.get_title()
template += u"%s\n" % title
setline = self.__nblines(template)
setcol = len(title)
-
+
desc = t.get_desc()
if desc: template += u"\n%s" % desc
-
+
template += self.EDIT_TEMPLATE
lines = edit_template(template, 'EDIT:', setline, setcol).split('\n')
@@ -1456,7 +1456,7 @@ OPTIONS
if not argv:
eerror("Il faut spécifier un numéro de tâche à marquer comme faite")
return
-
+
tf = self.__tf()
tasks, auto_filtered = self.__get_filtered(tf, argv,
indexes=indexes,
@@ -1505,7 +1505,7 @@ USAGE
if not argv:
eerror("Il faut spécifier un numéro de tâche à supprimer")
return
-
+
tf = self.__tf()
tasks, auto_filtered = self.__get_filtered(tf, argv,
indexes=indexes,
@@ -1523,7 +1523,7 @@ USAGE
self.update_projects(delete=deleted)
enote("%i tâche(s) supprimée(s)" % len(tasks))
-
+
############################################################################
def PURGE(self,
@@ -1554,7 +1554,7 @@ OPTIONS
elif opt in ('-h', '--help'):
uprint(self.PURGE.__doc__ % locals())
sys.exit(0)
-
+
projects = []
if not argv:
project = self.get_project()
@@ -1562,7 +1562,7 @@ OPTIONS
projects.append(project)
else:
projects.extend(argv)
-
+
tf = self.__tf()
pf = self.__pf()
now = datef()
diff --git a/lib/pyulib/migrate/tasks2/TiddlyWiki.py b/lib/pyulib/migrate/tasks2/TiddlyWiki.py
index ac94a10..11ff3a9 100755
--- a/lib/pyulib/migrate/tasks2/TiddlyWiki.py
+++ b/lib/pyulib/migrate/tasks2/TiddlyWiki.py
@@ -302,7 +302,7 @@ class TiddlyWiki:
END_SAVE_AREA = ''
START_DIV = '
\n')
return s
-
+
def get_htbody(self, truncate=None):
body = self._t.get_body() or u''
if truncate is not None and len(body) > truncate:
body = u'%s...' % body[:truncate]
return self._htmlize(body)
htbody = property(get_htbody)
-
+
TASK_TYPES = {TASK_TYPE: u'task-type',
PLAN_TYPE: u'task-type',
EVENT_TYPE: u'event-type',
@@ -84,15 +84,15 @@ class Server(Application):
def __init__(self, basedir=None, templatedir=None, host=None, port=None, debug=None,
tsrc=None, ctl=None):
self.template_globals = TEMPLATE_GLOBALS
-
+
Application.__init__(self, basedir, templatedir, host, port, debug)
-
+
if ctl is None: ctl = TasksCtl(tsrc)
self._ctl = ctl
self.OPTIONS = ctl.OPTIONS + self.FILTER_OPTIONS
self.LONG_OPTIONS = ctl.LONG_OPTIONS + self.FILTER_LONG_OPTIONS
self._ioptions = []
-
+
self.reset_hts()
self.reset_ts()
@@ -102,7 +102,7 @@ class Server(Application):
FILTER_LONG_OPTIONS = ['show-all', 'show-showable', 'show-doable', 'show-body', 'no-stats']
_ioptions = None # options initiales
_ifilter = None # filtre initial sous forme de chaine
-
+
def is_option(self, option, value):
if option in ('-a', '--show-all'): pass
elif option in ('-q', '--show-showable'): pass
@@ -116,12 +116,12 @@ class Server(Application):
else:
self._ioptions.append('%s%s' % (option, value))
return True
-
+
RE_PIPE = re.compile(ur'\s*\|\s*')
def process_args(self, args):
ioptions = self._ioptions
if ioptions and args[0:1] and args[0].startswith('-'):
- ioptions.append('--')
+ ioptions.append('--')
ioptions.extend(args)
self._cfilters = cfs = filter(None, self.RE_PIPE.split(join_args(ioptions)))
self._ifilter = cfs and cfs[0] or u''
@@ -134,7 +134,7 @@ class Server(Application):
def list_tasks(self, cfilter=None, ifilter=None):
if ifilter is None: ifilter = self._ifilter
if cfilter is None: cfilter = ifilter
-
+
fargs = split_args(cfilter)
options, fargs = self.ctl.get_args(fargs, self.FILTER_OPTIONS, self.FILTER_LONG_OPTIONS)
showwhat = None
@@ -164,11 +164,11 @@ class Server(Application):
ts = [t for t in ts if t.is_doable()]
ts.sort(Task.cmp, reverse=True)
nb_showable = len(ts)
-
+
tasks = [t for t in ts if t.is_task_type()]
nb_tasks = len(tasks)
nb_done = len([t for t in tasks if t.is_done()])
-
+
stats = web.storage(showwhat=showwhat,
showbody=showbody, showstats=showstats,
nb_showable=nb_showable, nb_total=nb_total,
@@ -177,13 +177,13 @@ class Server(Application):
def ht(self, t):
return self.render.task(t)
-
+
# cache du rendu des tâches
_hts, hts = make_prop('_hts', setter=False)[:2]
-
+
def reset_hts(self):
self._hts = {}
-
+
def update_hts(self, *ts, **kw):
force = kw.get('force', False)
hts = self._hts
@@ -191,7 +191,7 @@ class Server(Application):
tid = t.id
if force or not hts.has_key(tid):
hts[tid] = self.ht(t)
-
+
def remove_from_hts(self, *ts):
if self._hts is None: return
hts = self._hts
@@ -199,28 +199,28 @@ class Server(Application):
tid = t.id
if hts.has_key(tid):
del hts[tid]
-
+
# requêtes précédentes
_cfilters, cfilters = make_prop('_cfilters')[:2]
-
+
def new_cfilter(self, cfilter):
if cfilter is not None and cfilter not in self._cfilters:
self._cfilters.append(cfilter)
-
+
# cache du résultat de la recherche
_cfilter, cfilter = make_prop('_cfilter')[:2]
_stats, stats = make_prop('_stats')[:2]
_ts, ts = make_prop('_ts')[:2]
-
+
def reset_ts(self, reset_cfilter=False):
if reset_cfilter: self._cfilter = None
self._stats = None
self._ts = None
-
+
def refresh(self):
self.reset_hts()
self.reset_ts()
-
+
def set_query(self, cfilter=None, ifilter=None):
# vérifier s'il faut utiliser le cache de requête
if cfilter is None: cfilter = self._cfilter
@@ -229,16 +229,16 @@ class Server(Application):
self.reset_ts()
self.new_cfilter(cfilter)
return cfilter
-
+
def set_default_query(self):
self.reset_ts(True)
-
+
def reload_maybe(self):
stores = self.ctl.get_stores()
if stores.should_reload():
stores.load()
self.refresh()
-
+
def get_hts(self, cfilter=None, ifilter=None):
cfilter = self.set_query(cfilter, ifilter)
if self._ts is None:
@@ -257,10 +257,10 @@ class Server(Application):
def dt(self, t, all_values=True):
"""Transformer une tâche en un dictionnaire dont les clés sont les
attributs de la tâche.
-
+
Si all_values==True, inclure les attributs pour lesquels il n'y a pas
de valeur définie, avec la valeur None.
-
+
Les attributs du dictionnaire sont: tid, type, cdate, ddate, dates,
mindate, maxdate, date, title, body, contexts, projects, sid, id,
title1, task_type, event_type, idea_type, due_date, delay, urgent,
@@ -278,7 +278,7 @@ class Server(Application):
if all_values or value is not None:
td[name] = value
return td
-
+
def jsencode_tasks(self, cfilter, stats, ts):
dts = [self.dt(t) for t in ts]
return self.dumps(cfilter), self.dumps(dts), self.dumps(stats)
@@ -326,11 +326,11 @@ class Server(Application):
stores.save()
self.update_hts(force=True, *ts)
return ts
-
+
START = 'start'
STOP = 'stop'
TOGGLE = 'toggle'
-
+
def start_stop_or_toggle(self, action, tids=None, query=None):
stores = self.ctl.get_stores()
ts = self.get_tasks(tids, query)
@@ -349,7 +349,7 @@ class Server(Application):
stores.save()
self.update_hts(force=True, *ts)
return ts
-
+
def plan(self, args=None, tids=None):
date = Date()
options, args = get_args(args or [], 'd:', ['date='])
@@ -385,10 +385,10 @@ class Server(Application):
stores.save()
self.reset_ts()
return ts
-
+
class page(Page):
__abstract_page__ = True
-
+
reload_timeout = 5
ctl = make_delegate('app.ctl')
@@ -396,9 +396,9 @@ class page(Page):
stats = make_delegate('app.stats')
ts = make_delegate('app.ts')
hts = make_delegate('app.hts')
-
+
cfilters = make_delegate('app.cfilters')
-
+
@defaults(query=None)
def index(self):
try:
@@ -414,24 +414,24 @@ class page(Page):
traceback.print_exc()
self.add_last_error_msg()
return self.r('index', self)
-
+
class action(page):
PATH = r'/action'
reload_timeout = None # pas de rechargement automatique
-
+
MSG_FADE = (None, u'msg_fade') # classes css pour le message
@defaults(query=None)
def doSearch(self):
self.app.set_query(self.query)
return self.redirect('/')
-
+
def doAdd(self, args):
t = self.app.add(args)
self.add_msg(u"La tâche #%s a été créée avec succès" % t.id, self.MSG_FADE, level=1)
return self.redirect('/')
-
+
@defaults(tids=[], query=None)
def doEditForm(self):
t = self.app.get_tasks(self.tids, self.query, unique=True)[0]
@@ -452,12 +452,12 @@ class action(page):
def doDoOrNodo(self, action):
self.app.do_or_nodo(action, self.tids, self.query)
return self.redirect('/')
-
+
@defaults(tids=[], query=None)
def doStartStopOrToggle(self, action):
self.app.start_stop_or_toggle(action, self.tids, self.query)
return self.redirect('/')
-
+
@defaults(tids=[], query=None)
def doPlan(self, args=None):
if args is None: args = split_args(self.query)
@@ -475,16 +475,16 @@ class action(page):
def doRefresh(self):
self.app.refresh()
return self.redirect('/')
-
+
def doSetDefaultQuery(self):
self.app.set_default_query()
return self.redirect('/')
-
+
@defaults(store=None)
def doSetWStore(self):
self.app.ctl.get_stores().set_wstore(self.store)
return self.redirect('/')
-
+
SEARCH = 'search'
ADD = 'add'
EDIT_FORM = 'edit'
@@ -499,7 +499,7 @@ class action(page):
REFRESH = 'refresh'
DEFAULTS = 'defaults'
SET_WSTORE = '__sws__'
-
+
ACTIONS = {'S': SEARCH, 'L': SEARCH, 'l': SEARCH, 'ls': SEARCH, 'list': SEARCH,
'A': ADD, 'a': ADD, 'N': ADD, 'n': ADD, 'new': ADD,
'E': EDIT_FORM, 'e': EDIT_FORM, 'ed': EDIT_FORM,
@@ -513,7 +513,7 @@ class action(page):
'R': REFRESH,
'D': DEFAULTS, 'default': DEFAULTS,
}
-
+
@nocache
@defaults(name=None, query=None, tids=[], searchbtn=None, dobtn=None, nodobtn=None)
def action(self):
@@ -563,7 +563,7 @@ class index(page):
self.app.reload_maybe()
self.clear_msgs(0)
return page.index(self)
-
+
@nocache
@defaults(tid=None)
def edit(self):
diff --git a/lib/pyulib/src/uapps/tasks/httpd/static/blueprint/plugins/buttons/screen.css b/lib/pyulib/src/uapps/tasks/httpd/static/blueprint/plugins/buttons/screen.css
index bb66b21..c1bf8d3 100644
--- a/lib/pyulib/src/uapps/tasks/httpd/static/blueprint/plugins/buttons/screen.css
+++ b/lib/pyulib/src/uapps/tasks/httpd/static/blueprint/plugins/buttons/screen.css
@@ -1,8 +1,8 @@
-/* --------------------------------------------------------------
-
+/* --------------------------------------------------------------
+
buttons.css
* Gives you some great CSS-only buttons.
-
+
Created by Kevin Hale [particletree.com]
* particletree.com/features/rediscovering-the-button-element
@@ -15,7 +15,7 @@ a.button, button {
float:left;
margin: 0.7em 0.5em 0.7em 0;
padding:5px 10px 5px 7px; /* Links */
-
+
border:1px solid #dedede;
border-top:1px solid #eee;
border-left:1px solid #eee;
diff --git a/lib/pyulib/src/uapps/tasks/httpd/static/blueprint/plugins/fancy-type/readme.txt b/lib/pyulib/src/uapps/tasks/httpd/static/blueprint/plugins/fancy-type/readme.txt
index 85f2491..b921269 100644
--- a/lib/pyulib/src/uapps/tasks/httpd/static/blueprint/plugins/fancy-type/readme.txt
+++ b/lib/pyulib/src/uapps/tasks/httpd/static/blueprint/plugins/fancy-type/readme.txt
@@ -1,7 +1,7 @@
Fancy Type
-* Gives you classes to use if you'd like some
- extra fancy typography.
+* Gives you classes to use if you'd like some
+ extra fancy typography.
Credits and instructions are specified above each class
in the fancy-type.css file in this directory.
diff --git a/lib/pyulib/src/uapps/tasks/httpd/static/blueprint/plugins/link-icons/screen.css b/lib/pyulib/src/uapps/tasks/httpd/static/blueprint/plugins/link-icons/screen.css
index 6d3d47f..dbed2a5 100644
--- a/lib/pyulib/src/uapps/tasks/httpd/static/blueprint/plugins/link-icons/screen.css
+++ b/lib/pyulib/src/uapps/tasks/httpd/static/blueprint/plugins/link-icons/screen.css
@@ -1,22 +1,22 @@
-/* --------------------------------------------------------------
-
+/* --------------------------------------------------------------
+
link-icons.css
* Icons for links based on protocol or file type.
-
+
See the Readme file in this folder for additional instructions.
-------------------------------------------------------------- */
/* Use this class if a link gets an icon when it shouldn't. */
-body a.noicon {
- background:transparent none !important;
- padding:0 !important;
- margin:0 !important;
+body a.noicon {
+ background:transparent none !important;
+ padding:0 !important;
+ margin:0 !important;
}
/* Make sure the icons are not cut */
-a[href^="http:"], a[href^="mailto:"], a[href^="http:"]:visited,
-a[href$=".pdf"], a[href$=".doc"], a[href$=".xls"], a[href$=".rss"],
+a[href^="http:"], a[href^="mailto:"], a[href^="http:"]:visited,
+a[href$=".pdf"], a[href$=".doc"], a[href$=".xls"], a[href$=".rss"],
a[href$=".rdf"], a[href^="aim:"] {
padding:2px 22px 2px 0;
margin:-2px 0;
@@ -25,16 +25,16 @@ a[href$=".rdf"], a[href^="aim:"] {
}
/* External links */
-a[href^="http:"] { background-image: url(icons/external.png); }
+a[href^="http:"] { background-image: url(icons/external.png); }
a[href^="mailto:"] { background-image: url(icons/email.png); }
a[href^="http:"]:visited { background-image: url(icons/visited.png); }
/* Files */
-a[href$=".pdf"] { background-image: url(icons/pdf.png); }
-a[href$=".doc"] { background-image: url(icons/doc.png); }
-a[href$=".xls"] { background-image: url(icons/xls.png); }
-
+a[href$=".pdf"] { background-image: url(icons/pdf.png); }
+a[href$=".doc"] { background-image: url(icons/doc.png); }
+a[href$=".xls"] { background-image: url(icons/xls.png); }
+
/* Misc */
-a[href$=".rss"],
+a[href$=".rss"],
a[href$=".rdf"] { background-image: url(icons/feed.png); }
a[href^="aim:"] { background-image: url(icons/im.png); }
\ No newline at end of file
diff --git a/lib/pyulib/src/uapps/tasks/httpd/static/blueprint/plugins/rtl/screen.css b/lib/pyulib/src/uapps/tasks/httpd/static/blueprint/plugins/rtl/screen.css
index 7e7ccdb..db218dd 100644
--- a/lib/pyulib/src/uapps/tasks/httpd/static/blueprint/plugins/rtl/screen.css
+++ b/lib/pyulib/src/uapps/tasks/httpd/static/blueprint/plugins/rtl/screen.css
@@ -2,9 +2,9 @@
rtl.css
* Mirrors Blueprint for left-to-right languages
-
+
By Ran Yaniv Hartstein [ranh.co.il]
-
+
-------------------------------------------------------------- */
body .container { direction: rtl; }
@@ -12,13 +12,13 @@ body .column, body div.span-1, body div.span-2, body div.span-3, body div.span-4
float: right;
margin-right: 0;
margin-left: 10px;
- text-align:right;
+ text-align:right;
}
body div.last { margin-left: 0; }
body table .last { padding-left: 0; }
-body .append-1 { padding-right: 0; padding-left: 40px; }
+body .append-1 { padding-right: 0; padding-left: 40px; }
body .append-2 { padding-right: 0; padding-left: 80px; }
body .append-3 { padding-right: 0; padding-left: 120px; }
body .append-4 { padding-right: 0; padding-left: 160px; }
@@ -42,7 +42,7 @@ body .append-21 { padding-right: 0; padding-left: 840px; }
body .append-22 { padding-right: 0; padding-left: 880px; }
body .append-23 { padding-right: 0; padding-left: 920px; }
-body .prepend-1 { padding-left: 0; padding-right: 40px; }
+body .prepend-1 { padding-left: 0; padding-right: 40px; }
body .prepend-2 { padding-left: 0; padding-right: 80px; }
body .prepend-3 { padding-left: 0; padding-right: 120px; }
body .prepend-4 { padding-left: 0; padding-right: 160px; }
diff --git a/lib/pyulib/src/uapps/tasks/httpd/static/blueprint/plugins/tabs/README.textile b/lib/pyulib/src/uapps/tasks/httpd/static/blueprint/plugins/tabs/README.textile
index 604837b..2012f00 100644
--- a/lib/pyulib/src/uapps/tasks/httpd/static/blueprint/plugins/tabs/README.textile
+++ b/lib/pyulib/src/uapps/tasks/httpd/static/blueprint/plugins/tabs/README.textile
@@ -1,13 +1,13 @@
h1. Blueprint CSS Tabs Plugin Readme
-This plugin adds a simple and flexible set of horizontal tabs to Blueprint.
+This plugin adds a simple and flexible set of horizontal tabs to Blueprint.
-h2. Usage:
+h2. Usage:
# Upload the screen.css file to a new directory on your server (preferably tabsplugin/)
-# Include the plugin file in the @
@ of your webpage.
+# Include the plugin file in the @