Commit 906c60c9 authored by Yannick Chudy's avatar Yannick Chudy

weight property after load

parent 79411759
......@@ -4,7 +4,7 @@ import os
import sys
import argparse
from botapi import Botagraph, BotApiError
from reliure.types import Text
from reliure.types import Text , Numeric
from collections import namedtuple
import codecs
......@@ -564,7 +564,7 @@ class Botapad(object):
self.log(node)
etname = "%s_%s" % (src, tgt)
edgeprops = { "label": Text(), }
edgeprops = { "label": Text(), 'weight' :Numeric( vtype=float, default=1. ) }
if etname not in self.edgetypes:
self.edgetypes[etname] = self.bot.post_edgetype(self.gid, etname, etname, edgeprops)
......@@ -583,7 +583,7 @@ class Botapad(object):
if prop.iscliq :
cliqname = "%s_clique" % (prop.name)
if cliqname not in self.edgetypes:
self.edgetypes[cliqname] = self.bot.post_edgetype(self.gid, cliqname, cliqname, nodeprops)
self.edgetypes[cliqname] = self.bot.post_edgetype(self.gid, cliqname, cliqname, edgeprops)
for e, t in enumerate(targets):
for t2 in targets[e+1:]:
......@@ -610,6 +610,7 @@ class Botapad(object):
'edgetype': self.edgetypes[etname]['uuid'],
'source': self.idx[srcid],
'target': self.idx[tgtid],
'weight' : prop.weight,
'properties': { "label" : etname, 'weight' : prop.weight, }
} )
......
......@@ -262,7 +262,7 @@ def pad2igraph(gid, url, format="csv"):
botapad = Botapad(bot , gid, description, delete=DELETE, verbose=False, debug=False)
#botapad.parse(url, separator='auto', debug=app.config['DEBUG'])
botapad.parse(url, separator='auto', debug=False)
graph = bot.get_igraph(weight_prop=True)
graph = bot.get_igraph(weight_prop="weight")
if graph.vcount() == 0 :
raise BotapadParseError(url, "Botapad can't create a graph without nodes.", None )
......@@ -394,7 +394,11 @@ def botimport(repo, padurl, gid, content_type):
promote = 1 if request.form.get('promote', 0) else 0
graphurl = "#/import/igraph.html?s=%s&gid=%s&nofoot=1" % (padurl, gid)
graphurl = "?%s" % "&".join([ "%s=%s" % (k,args.get(k)) for k in args.keys()])
graphurl = u"?%s" % "&".join([ "%s=%s" % (k,request.args.get(k)) for k in request.args])
for k in request.args:
print "KEY", k, request.args.get(k)
options = {
#
......
......@@ -332,8 +332,7 @@
</script>
</div>
<padagraph-node-search actions="add,explore"></padagraph-node-search>{% if graphurl %} <a href="{{graphurl}}" class="ui active refresh button">refresh</a>
<!--a.ui.active.primary.button(href="{{padurl}}") edit-->{% endif %}
<padagraph-node-search actions="add,explore"></padagraph-node-search>{% if graphurl %} <a href="{{graphurl}}" class="ui active refresh button">refresh</a>{% endif %}
</div>{% elif error %}
<div class="ui text container">
<h3 class="ui inverted horizontal divider">Import error </h3>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment