Skip to content

Commit

Permalink
remove post_config_hook because expanduser and glob must be done for
Browse files Browse the repository at this point in the history
each check
  • Loading branch information
cyrinux committed Jun 9, 2018
1 parent 3054842 commit a932a69
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions py3status/modules/file_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ class Meta:
],
}

def post_config_hook(self):
if self.path:
self.path = map(expanduser, glob(self.path))

def file_status(self):
if self.path is None:
return {
Expand All @@ -69,12 +65,19 @@ def file_status(self):
'cached_until': self.py3.CACHE_FOREVER,
}

paths = glob(expanduser(self.path))
if isinstance(paths, str):
paths = [paths]

icon = self.icon_unavailable
color = self.py3.COLOR_BAD
for path in self.path:

for path in paths:
self.py3.log(path)
if exists(path):
icon = self.icon_available
color = self.py3.COLOR_GOOD
break

response = {
'cached_until': self.py3.time_in(self.cache_timeout),
Expand Down

0 comments on commit a932a69

Please sign in to comment.