Skip to content

Commit

Permalink
Solve problem having an empty calendarlist
Browse files Browse the repository at this point in the history
  • Loading branch information
TRMSC authored Apr 9, 2022
1 parent ec51297 commit 7a544db
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions cloud-backup-settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#!/usr/bin/env python

# Cloud Backup - Copyright (C) 2022, TRMSC - https://trmsc1.wordpress.com/
# Cloud Backup v.1.1.filedev - Copyright (C) 2022, TRMSC - https://trmsc1.wordpress.com/
# GNU General Public Licence 3.0 - http://www.gnu.de/documents/gpl-3.0.en.html

import configparser
Expand All @@ -15,7 +15,7 @@
def initConfig():
val = readData()
encr = encryptPwd(val)
print ("\n- - - - - - - - - - - - - - - - -\n")
print ("\n- - - - - - - - - - - - - - - - -")
print ("Last modified: " + val[0] + "\n")
print (" 1 - GENERAL - Change backup directory (" + val[1] + ")")
print (" 2 - GENERAL - Number of stored backups (" + val[2] + ")")
Expand Down Expand Up @@ -164,13 +164,15 @@ def openCallist ():
calendarlist = val[9].replace('\n', "").split(",")
listcontent = val[9]
choice = "x"
empty = 0
while choice != "":
items = len(calendarlist)
itemsDisp = items + 1
position = 0
print("")
if position == items:
print ("No calendarlists...")
empty = 1
else:
while position < items:
posDisp = position + 1
Expand All @@ -191,7 +193,11 @@ def openCallist ():
elif isInt and int(choice) >= itemsDisp:
print ("CALENDAR DOES NOT EXIST.")
elif choice != "":
listcontent = listcontent + "," + choice
if empty == 1:
listcontent = choice
empty = 0
else:
listcontent = listcontent + "," + choice
calendarlist = listcontent.replace('\n', "").split(",")
print (listcontent)
print ("\nOld version: " + val[9])
Expand Down

0 comments on commit 7a544db

Please sign in to comment.