Skip to content

Commit

Permalink
Updated Common version and logger about argument errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rabits committed Apr 11, 2018
1 parent 0efb216 commit fd05d5d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/Common
Submodule Common updated 1 files
+6 −2 Common.py
9 changes: 6 additions & 3 deletions vk-backup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python
# -*- coding: UTF-8 -*-
'''VK-Backup 0.8.0
'''VK-Backup 0.8.1
Author: Rabit <[email protected]>
License: GPL v3
Expand All @@ -15,6 +15,7 @@
from lib import vk_auth

import getpass, os
from sys import exit

c.init_begin(__doc__)
c.option('-u', '--user', type='string', dest='user', metavar='EMAIL', default=None, help='vk.com account user email (<user>@<host>) (required)')
Expand All @@ -24,13 +25,15 @@
c.init_end()

if c.cfg('user') == None:
parser.error('Unable to get email from the user option')
c.log('error', 'Unable to get email from the user option')
exit(1)

if c.cfg('password') == None:
c.cfg('password', getpass.getpass())

if c.cfg('download-threads') < 0:
parser.error('Number of download threads can\'t be lower then zero')
c.log('error', 'Number of download threads can\'t be lower then zero')
exit(1)

class Backup:
def __init__(self):
Expand Down

0 comments on commit fd05d5d

Please sign in to comment.