Skip to content

Commit

Permalink
fix for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
skelsec committed Feb 21, 2021
1 parent b99bca7 commit b9f5366
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions jackdaw/nest/graph/backends/igraph/domaingraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ def create(dbsession, graph_id, graph_dir, sqlite_file = None):
# Solution: if sqlite is used as the database backend we can use the sqlite3 cmdline utility to do the dumping much faster
#

sf = sqlite_file
gf = graph_file
sf = str(sqlite_file)
gf = str(graph_file)
if platform.system() == 'Windows':
sf = sf.replace('\\', '\\\\')
gf = gf.replace('\\', '\\\\')
qry_str = '.open %s\r\n.mode csv\r\n.output %s\r\n.separator " "\r\nSELECT src,dst FROM adedges, adedgelookup WHERE adedges.graph_id = %s AND adedgelookup.id = adedges.src AND adedgelookup.oid IS NOT NULL;\r\n.exit' % (sf, graph_file, graph_id)
qry_str = '.open %s\r\n.mode csv\r\n.output %s\r\n.separator " "\r\nSELECT src,dst FROM adedges, adedgelookup WHERE adedges.graph_id = %s AND adedgelookup.id = adedges.src AND adedgelookup.oid IS NOT NULL;\r\n.exit' % (sf, gf, graph_id)
with open('buildnode.sql', 'w', newline='') as f:
f.write(qry_str)

Expand Down
6 changes: 3 additions & 3 deletions jackdaw/nest/graph/backends/networkx/domaingraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ def create(dbsession, graph_id, graph_dir, sqlite_file = None):
# Solution: if sqlite is used as the database backend we can use the sqlite3 cmdline utility to do the dumping much faster
#

sf = sqlite_file
gf = graph_file
sf = str(sqlite_file)
gf = str(graph_file)
if platform.system() == 'Windows':
sf = sf.replace('\\', '\\\\')
gf = gf.replace('\\', '\\\\')

qry_str = '.open %s\r\n.mode csv\r\n.output %s\r\n.separator " "\r\nSELECT src,dst FROM adedges, adedgelookup WHERE adedges.graph_id = %s AND adedgelookup.id = adedges.src AND adedgelookup.oid IS NOT NULL;\r\n.exit' % (sqlite_file, graph_file, graph_id)
qry_str = '.open %s\r\n.mode csv\r\n.output %s\r\n.separator " "\r\nSELECT src,dst FROM adedges, adedgelookup WHERE adedges.graph_id = %s AND adedgelookup.id = adedges.src AND adedgelookup.oid IS NOT NULL;\r\n.exit' % (sf, gf, graph_id)
with open('buildnode.sql', 'w') as f:
f.write(qry_str)

Expand Down

0 comments on commit b9f5366

Please sign in to comment.