def GET(self, key):
     i = web.input(key=None)
     gt = GitTessera()
     tessera = gt.get(i.key)
     if not tessera:
         return "not found"
     render = web.template.render("%s/web" % path.dirname(path.realpath(__file__)))
     tessera.markdown = markdown.markdown(tessera.content)
     return render.detail(tessera)
 def cmd_create(self, args):
     #if self.git.is_dirty():
     #    stderr.write("repo is dirty\n")
     #    return False
     gt = GitTessera(self._config)
     t = gt.create(" ".join(args)) if args else gt.create()
     _edit(t.filename, self._config)
     gt.commit(t)
     return True
Example #3
0
 def GET(self, key):
     self._config = TesseraConfig(path.join(Tessera._tesserae, "config"))
     i = web.input(key=None)
     gt = GitTessera(self._config)
     tessera = gt.get(i.key)
     if not tessera:
         return "not found"
     render = web.template.render('%s/web' % path.dirname(path.realpath(__file__)))
     tessera.markdown = markdown.markdown(tessera.content)
     return render.detail(tessera)
Example #4
0
 def GET(self, key):
     self._config = TesseraConfig(path.join(Tessera._tesserae, "config"))
     i = web.input(key=None)
     gt = GitTessera(self._config)
     tessera = gt.get(i.key)
     if not tessera:
         return "not found"
     render = web.template.render('%s/web' %
                                  path.dirname(path.realpath(__file__)))
     tessera.markdown = markdown.markdown(tessera.content)
     return render.detail(tessera)
    def cmd_show(self, args):
        if len(args) != 1:
            raise ArgumentError("git tessera show takes identifier as argument")

        gt = GitTessera(self._config)
        t = gt.get(args[0])
        if not t:
            return False

        short = t.summary()
        length = len(short)
        print "=" * length
        print short
        print "=" * length
        print t.content
        return True
Example #6
0
    def cmd_show(self, args):
        if len(args) != 1:
            raise ArgumentError(
                "git tessera show takes identifier as argument")

        gt = GitTessera(self._config)
        t = gt.get(args[0])
        if not t:
            return False

        short = t.summary()
        length = len(short)
        print "=" * length
        print short
        print "=" * length
        print t.content
        return True
Example #7
0
    def cmd_show(self, args):
        if len(args) != 1:
            stderr.write("git tessera show takes identifier as argument\n")
            return False

        gt = GitTessera()
        t = gt.get(args[0])
        if not t:
            return False

        short = t.summary()
        length = len(short)
        print "=" * length
        print short
        print "=" * length
        print t.content
        return True
Example #8
0
    def cmd_create(self, args):
        #if self.git.is_dirty():
        #    stderr.write("repo is dirty\n")
        #    return False
        gt = GitTessera(self._config)
        t = gt.create(" ".join(args)) if args else gt.create()
        while True:
            _edit(t.filename, self._config)
            if t.update():
                gt.commit(t)
                return True
            stdout.write("Abort ? [y/N] ")
            try:
                answer = stdin.readline().strip()
            except KeyboardInterrupt:
                break
            if answer and answer.lower() == "y":
                break

        return False
Example #9
0
    def cmd_create(self, args):
        #if self.git.is_dirty():
        #    stderr.write("repo is dirty\n")
        #    return False
        gt = GitTessera(self._config)
        t = gt.create(" ".join(args)) if args else gt.create()
        while True:
            _edit(t.filename, self._config)
            if t.update():
                gt.commit(t)
                return True
            stdout.write("Abort ? [y/N] ")
            try:
                answer = stdin.readline().strip()
            except KeyboardInterrupt:
                break
            if answer and answer.lower() == "y":
                break

        return False
Example #10
0
 def GET(self):
     self._config = TesseraConfig(path.join(Tessera._tesserae, "config"))
     gt = GitTessera(self._config)
     tesserae = gt.ls()
     return render.index(tesserae)
 def GET(self):
     gt = GitTessera()
     tesserae = gt.ls()
     return render.index(tesserae)
 def cmd_ls(self, args):
     gt = GitTessera(self._config)
     tesserae = gt.ls(args)
     for t in tesserae:
         print t.summary()
     return True
Example #13
0
 def cmd_ls(self, args):
     gt = GitTessera(self._config)
     tesserae = gt.ls(args)
     for t in tesserae:
         print t.summary()
     return True
Example #14
0
 def GET(self):
     self._config = TesseraConfig(path.join(Tessera._tesserae, "config"))
     gt = GitTessera(self._config)
     tesserae = gt.ls()
     return render.index(tesserae)