Changeset 7b6d348


Ignore:
Timestamp:
Sep 15, 2018, 3:09:30 PM (8 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
debian/bullseye, master
Children:
b76295a
Parents:
cb89b0e
git-author:
Joachim Langenbach <joachim.langenbach@…> (09/15/18 15:04:54)
git-committer:
Joachim Langenbach <joachim.langenbach@…> (09/15/18 15:09:30)
Message:

Using os.path.join to generate paths to files

Location:
src/python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/python/bin/gnuboat-log-analyser

    rcb89b0e r7b6d348  
    137137
    138138        # create ogr file info
    139         source_xml_file = "{}/{}".format(output_directory, "ogr_input_file.vrt")
     139        source_xml_file = os.path.join(output_directory, "ogr_input_file.vrt")
    140140        try:
    141                 output_file = open(source_xml_file, 'w')
     141                output_file = open(source_xml_file, 'wb')
    142142        except IOError as error:
    143143                print('ERROR: Could not open the output file for the ogr data source description: {}'.format(error))
    … …  
    179179       
    180180        # create the grid data
     181        gdal_file = os.path.join(output_directory, "water_depth.tif")
    181182        grid_options = gdal.GridOptions(format = "GTiff", width = target_x_res, height = target_y_res, outputSRS = "WGS84", noData = target_nodata_value, layers = source_data_layer)
    182183        #gdal.Grid("/tmp/test.tif", source_xml_file)
    183         gdal.Grid("/tmp/test.tif", source_xml_file, options = grid_options)
     184        gdal.Grid(gdal_file, source_xml_file, options = grid_options)
    184185
    185186        # creating pipeline
  • src/python/gnuboat/datahandler/loghandler.py

    rcb89b0e r7b6d348  
    1717'''
    1818
     19import os
    1920import re
    2021import pynmea2
    … …  
    5657                                self._nmea_file_date = nmea_file_date_should
    5758                                nmea_log_file = 'nmea0183-{}.log'.format(self._nmea_file_date)
    58                                 self._nmea_file = open('{}/{}'.format(self._log_directory, nmea_log_file), 'a', 0)
     59                                self._nmea_file = open(os.path.join(self._log_directory, nmea_log_file), 'a', 0)
    5960                        except IOError as error:
    6061                                print('Could not open the logfile: {}'.format(error))
Note: See TracChangeset for help on using the changeset viewer.