Browse Source

Buxfix: Fixed logging with -l option

pull/23/head
Mikołaj 'lich' Halber 4 years ago
parent
commit
08b225866a
3 changed files with 10 additions and 4 deletions
  1. 8
    2
      limf/parse_arguments.py
  2. 1
    1
      limf/uploader.py
  3. 1
    1
      setup.py

+ 8
- 2
limf/parse_arguments.py View File

@@ -59,7 +59,10 @@ def parse_arguments(args, clone_list):
else:
returned_string = upload_files(open(i, 'rb'), \
clone_list[host_number], args.only_link, i)
print(returned_string)
if args.only_link:
print(returned_string[0])
else:
print(returned_string)
except IndexError:
#print('Selected server (' + clone_list[host_number][0] + ') is offline.')
#print('Trying other host.')
@@ -71,7 +74,10 @@ def parse_arguments(args, clone_list):
if args.log:
with open(os.path.expanduser(args.logfile), "a+") as logfile:
logfile.write(returned_string)
if args.only_link:
logfile.write(returned_string[1])
else:
logfile.write(returned_string)
logfile.write("\n")
break
else:

+ 1
- 1
limf/uploader.py View File

@@ -19,7 +19,7 @@ def upload_files(selected_file, selected_host, only_link, file_name):
file_name_1 = re.findall(r'"url": *"((h.+\/){0,1}(.+))"[,\}]', \
answer.text.replace("\\", ""))[0][2]
if only_link:
return selected_host[1]+file_name_1
return [selected_host[1]+file_name_1, "{}: {}{}".format(file_name, selected_host[1], file_name_1)]
else:
return "{}: {}{}".format(file_name, selected_host[1], file_name_1)
except requests.exceptions.ConnectionError:

+ 1
- 1
setup.py View File

@@ -9,7 +9,7 @@ from setuptools import setup

setup(
name='limf',
version='0.6.0',
version='0.6.1',
url='http://github.com/lich/limf',
license='MIT',
author='Mikolaj \'lich\' Halber',

Loading…
Cancel
Save