Commit 9f4fdb9a authored by Gerion Entrup's avatar Gerion Entrup
Browse files

change to relative paths

parent fca22b6b
......@@ -3,3 +3,5 @@ default_mode_file = 0o444
fetcher_cache_length = 10000
fetcher_cache_age = 172800 # 48 hours
directory_prefix = '/'
......@@ -7,6 +7,8 @@ import logging
import settings
from utils import get_path
class FuseIO():
"""Represents a folder or a file.
......@@ -419,7 +421,7 @@ class FuseFile(FuseIO, Node):
def open(self):
"""Opens the file."""
self._file = open(self._path, 'rb')
self._file = open(get_path(self._path), 'rb')
def close(self):
"""Closes the file."""
......
import os.path
import settings
from code import InteractiveConsole
from inspect import currentframe
def get_path(relative_path):
return os.path.join(settings.directory_prefix, relative_path)
def pairwise(iterable):
"s -> (s0,s1), (s2,s3), (s4, s5), ..."
a = iter(iterable)
return zip(a, a)
def debug_breakpoint():
"""
Python debug breakpoint.
"""
from code import InteractiveConsole
from inspect import currentframe
try:
import readline # noqa
except ImportError:
pass
caller = currentframe().f_back
env = {}
......
......@@ -2,6 +2,7 @@ import os
import mutagen
import threading
import logging
import settings
from model import Recording
from collector import Paths
......@@ -36,7 +37,9 @@ class Walker(threading.Thread):
if mut is not None:
mbid = self.get_mbid(mut)
if mbid is not None and mbid not in self._mbids:
Paths.put((mbid, os.path.abspath(filepath)))
Paths.put((mbid,
os.path.relpath(filepath,
settings.directory_prefix)))
self._mbids.add(mbid)
def get_mbid(self, mut):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment