from builtins import str from builtins import range from random import randint,seed from noodles.http import Response import dateutil.parser from tasks import gso from config import STATUSES,RENDER_URL,DATADIR,URL_PREFIX,NOPUSH,NOCOMMIT,METASTATES,APP_DIR from config_local import WEBAPP_FORCE_IDENTITY from noodles.http import Redirect,BaseResponse,Response,ajax_response,Error403 from webob import exc from noodles.templates import render_to from docs import initvars from pg import get_repos,get_usernames,hasperm,hasperm_db,get_participants,get_all_journals,get_children,get_journals,get_cross_links,get_task,get_tags from notif import parse import config as cfg initvars(cfg) from docs import cre,date_formats,parse_attrs,get_fns,get_parent_descriptions,rewrite,get_new_idx,add_task,get_parent,flush_taskfiles_cache,tasks_validate, get_karma, get_karma_receivers, deps_validate from docs import loadmeta,org_render,parsegitdate,read_current_metastates,read_journal,render_journal_content,append_journal_entry,Task,get_latest,metastates_agg,metastates_qry,P, gantt_info,gantt_info_row,dhtmlgantt_dfmt,iso_dfmt import codecs import copy import datetime from time import time import orgparse import os import re import redis import json import humanize from functools import partial,reduce,cmp_to_key
def __init__(self,tc): docs.initvars(cfg) if not os.path.exists(cfg.DATADIR): os.mkdir(cfg.DATADIR) st,op = gso('rm -rf %s/*'%cfg.DATADIR) ; assert st==0 unittest.TestCase.__init__(self,tc)
import datetime from couchdbkit import * from couchdbkit.designer import push from docs import initvars import config as cfg import sys import json # Wrap sys.stdout into a StreamWriter to allow writing unicode. import codecs import locale sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.stdout) # done initvars(cfg) from couchdb import * if __name__=='__main__': s,d = init_conn() push_views(d) if len(sys.argv)<2: sys.exit(0) tid = sys.argv[1] t = get_task(tid) print 'QUERIED TASK:' print t._id,t.summary tasks = get_children(tid)