diff --git a/plotid/example.py b/plotid/example.py index 7e41ff8141faee4152dfb48dd15f945518da4fa6..344f3104c96e620d4ee827b1d1f058541cf0b60b 100644 --- a/plotid/example.py +++ b/plotid/example.py @@ -56,5 +56,5 @@ IMGS_AS_LIST = [IMG1, IMG2] # plots or images. publish(['../README.md', '../docs', '../LICENSE'], - '/home/chief/Dokumente/fst/plotid_python/data', + '/home/chief/Dokumente/fst/plotid_python/data/', TAGGED_FIGS, 'Bild') diff --git a/plotid/publish.py b/plotid/publish.py index 79a926bd592b2061d913c2f686d76379a1191db7..2b7f2d12515070a9f4272bb653dcb9fb234b94f8 100644 --- a/plotid/publish.py +++ b/plotid/publish.py @@ -55,6 +55,13 @@ class PublishOptions: self.data_storage = data_storage self.dst_path_head, self.dst_dirname = os.path.split(self.dst_path) + # If the second string after os.path.split is empty, + # a trailing slash was given. + # To get the dir name correctly, split the first string again. + if not self.dst_dirname: + self.dst_path_head, self.dst_dirname = os.path.split( + self.dst_path_head) + def validate_input(self): """ Validate if input for PublishOptions is correct type.