Changeset 7873:2e6e5aae1e9d in orange


Ignore:
Timestamp:
04/21/11 10:18:18 (3 years ago)
Author:
matija <matija.polajnar@…>
Branch:
default
Convert:
bf3f97fcec65680c61173d64400000941967aac3
Message:

Orange.network.readwrite: generate_pajek didn't correctly escape objects.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/network/readwrite.py

    r7858 r7873  
    139139        s = ' '.join(map(make_str,(nodenumber[u],nodenumber[v],value))) 
    140140        for k,v in d.items(): 
    141             if is_string_like(v): 
    142                 # add quotes to any values with a blank space 
    143                 if " " in v:  
    144                     v="\"%s\""%v 
     141            if not is_string_like(v): 
     142                v = repr(v) 
     143            # add quotes to any values with a blank space 
     144            if " " in v:  
     145                v="\"%s\"" % v.replace('"', r'\"') 
    145146            s += ' %s %s'%(k,v) 
    146147        yield s 
Note: See TracChangeset for help on using the changeset viewer.