Added support for the ~ path shortcut when loading flows from disk.

for consistency. Saving flows supports using paths with the ~ shortcut.
This commit is contained in:
Matt Weidner 2017-07-21 16:25:16 -05:00
parent b7f864b6bb
commit 05db6e32c7
1 changed files with 2 additions and 0 deletions

View File

@ -10,6 +10,7 @@ The View:
""" """
import collections import collections
import typing import typing
import os
import blinker import blinker
import sortedcontainers import sortedcontainers
@ -339,6 +340,7 @@ class View(collections.Sequence):
""" """
Load flows into the view, without processing them with addons. Load flows into the view, without processing them with addons.
""" """
path = os.path.expanduser(path)
try: try:
with open(path, "rb") as f: with open(path, "rb") as f:
for i in io.FlowReader(f).stream(): for i in io.FlowReader(f).stream():