Compare commits
3 Commits
0.3.1
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
051f259fa7 | ||
|
|
94023a986d | ||
|
|
5909e7330b |
8
.github/dependabot.yml
vendored
Normal file
8
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: pip
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
time: "17:00"
|
||||
open-pull-requests-limit: 10
|
||||
@@ -1,5 +1,13 @@
|
||||
from pbincli.format import Paste
|
||||
from pbincli.utils import PBinCLIError
|
||||
import signal
|
||||
|
||||
def signal_handler(sig, frame):
|
||||
print('Keyboard interrupt received, terminating...')
|
||||
exit(0)
|
||||
|
||||
signal.signal(signal.SIGINT, signal_handler)
|
||||
|
||||
|
||||
def send(args, api_client, settings=None):
|
||||
from pbincli.api import Shortener
|
||||
|
||||
@@ -3,7 +3,7 @@ import os, sys, argparse
|
||||
|
||||
import pbincli.actions
|
||||
from pbincli.api import PrivateBin
|
||||
from pbincli.utils import PBinCLIException, validate_url
|
||||
from pbincli.utils import PBinCLIException, PBinCLIError, validate_url
|
||||
|
||||
CONFIG_PATHS = [os.path.join(".", "pbincli.conf", ),
|
||||
os.path.join(os.getenv("HOME") or "~", ".config", "pbincli", "pbincli.conf") ]
|
||||
@@ -13,8 +13,13 @@ def read_config(filename):
|
||||
settings = {}
|
||||
with open(filename) as f:
|
||||
for l in f.readlines():
|
||||
key, value = l.strip().split("=")
|
||||
settings[key.strip()] = value.strip()
|
||||
if len(l.strip()) == 0:
|
||||
continue
|
||||
try:
|
||||
key, value = l.strip().split("=")
|
||||
settings[key.strip()] = value.strip()
|
||||
except ValueError:
|
||||
PBinCLIError("Unable to parse config file, please check it for errors.")
|
||||
|
||||
return settings
|
||||
|
||||
|
||||
Reference in New Issue
Block a user