Skip to content

Commit

Permalink
Remove config module, used on Osmose
Browse files Browse the repository at this point in the history
  • Loading branch information
jocelynj committed Oct 5, 2020
1 parent cc4cd51 commit 17e5e9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions osc_modif/modules/OsmBin.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,7 @@ def RelationCreate(self, data):
class Test(unittest.TestCase):
def setUp(self):
import shutil
from modules import config
self.test_dir = config.dir_tmp + "/tests/osmbin/"
self.test_dir = "tmp/osmbin/"
shutil.rmtree(self.test_dir, True)
InitFolder(self.test_dir)
self.a = OsmBin(self.test_dir, "w")
Expand Down
7 changes: 4 additions & 3 deletions osc_modif/modules/OsmPbf_libosmbf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
###########################################################################

import dateutil.parser
from . import config
from .osm_pbf_parser import osm_pbf_parser
from .OsmState import OsmState
import subprocess
Expand All @@ -29,6 +28,8 @@

class OsmPbfReader(OsmReader, osm_pbf_parser.Visitor):

bin_osmconvert = "/usr/bin/osmconvert"

def log(self, txt):
self._logger.log(txt)

Expand All @@ -50,7 +51,7 @@ def timestamp(self):
else:
try:
# Try to get timestamp from metadata
res = subprocess.check_output([config.bin_osmconvert, self._pbf_file, '--out-timestamp']).decode('utf-8')
res = subprocess.check_output([self.bin_osmconvert, self._pbf_file, '--out-timestamp']).decode('utf-8')
d = dateutil.parser.parse(res).replace(tzinfo=None)
if not d:
raise ValueError()
Expand All @@ -60,7 +61,7 @@ def timestamp(self):

try:
# Compute max timestamp from data
res = subprocess.check_output('{} {} --out-statistics | grep "timestamp max"'.format(config.bin_osmconvert, self._pbf_file), shell=True).decode('utf-8')
res = subprocess.check_output('{} {} --out-statistics | grep "timestamp max"'.format(self.bin_osmconvert, self._pbf_file), shell=True).decode('utf-8')
s = res.split(' ')[2]
return dateutil.parser.parse(s).replace(tzinfo=None)

Expand Down

0 comments on commit 17e5e9f

Please sign in to comment.