Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
markotoplak committed Oct 5, 2017
1 parent d938e93 commit e6b3cbb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions Orange/widgets/data/owfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
from AnyQt.QtCore import Qt, QTimer, QSize

from Orange.canvas.gui.utils import OSX_NSURL_toLocalFile
from Orange.data import StringVariable
from Orange.data.table import Table, get_sample_datasets_dir
from Orange.data.io import FileFormat, UrlReader, class_from_qualified_name
from Orange.widgets import widget, gui
from Orange.widgets.settings import Setting, ContextSetting, \
PerfectDomainContextHandler, SettingProvider
from Orange.widgets.utils.domaineditor import DomainEditor
from Orange.widgets.utils.itemmodels import PyListModel
from Orange.widgets.utils.filedialogs import RecentPathsWComboMixin, dialog_formats, \
from Orange.widgets.utils.filedialogs import RecentPathsWComboMixin, \
open_filename_dialog
from Orange.widgets.widget import Output

Expand All @@ -41,7 +40,7 @@ def add_origin(examples, filename):
return
vars = examples.domain.variables + examples.domain.metas
strings = [var for var in vars if var.is_string]
dir_name, basename = os.path.split(filename)
dir_name, _ = os.path.split(filename)
for var in strings:
if "type" in var.attributes and "origin" not in var.attributes:
var.attributes["origin"] = dir_name
Expand Down
4 changes: 1 addition & 3 deletions Orange/widgets/utils/filedialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,6 @@ def search(self, searchpaths):
path = os.path.join(base, self.relpath)
if os.path.exists(path):
return os.path.normpath(path)
else:
return None

def resolve(self, searchpaths):
if self.prefix is None and os.path.exists(self.abspath):
Expand Down Expand Up @@ -371,7 +369,7 @@ def select_file(self, n):

def last_path(self):
"""Return the most recent absolute path or `None` if there is none"""
return self.recent_paths and self.recent_paths[0].abspath or None
return self.recent_paths[0].abspath if self.recent_paths else None


class RecentPathsWComboMixin(RecentPathsWidgetMixin):
Expand Down

0 comments on commit e6b3cbb

Please sign in to comment.