|
|
@ -51,11 +51,19 @@ parser.add_argument("-y", |
|
|
|
action="store_true", |
|
|
|
help="show the whole year") |
|
|
|
parser.add_argument("-n", |
|
|
|
action="store_const", |
|
|
|
const=int, |
|
|
|
action="store", |
|
|
|
type=int, |
|
|
|
help="show n months") |
|
|
|
|
|
|
|
args = vars(parser.parse_args()) |
|
|
|
|
|
|
|
# some stubs for now |
|
|
|
if args["create"]: |
|
|
|
print("Not implemented") |
|
|
|
exit(0) |
|
|
|
if args["json"]: |
|
|
|
print("Not implemented") |
|
|
|
exit(0) |
|
|
|
#check some stuff, do some warnings, initiate the config, etc. |
|
|
|
if not os.path.exists(configpath): |
|
|
|
config['DEFAULT'] = {'uri': 'your caldav server here', |
|
|
@ -238,6 +246,7 @@ for year,month in ympairs((args['year'],args['month']),offset,dstart=args['3']): |
|
|
|
month, |
|
|
|
cell_modifier=lambdafunc)) |
|
|
|
|
|
|
|
# function to print 3 calendar lines at a time |
|
|
|
def printlines(c1,c2,c3): |
|
|
|
for count in range(len(c1)): |
|
|
|
line = "" |
|
|
@ -245,9 +254,12 @@ def printlines(c1,c2,c3): |
|
|
|
if len(c2) > 0: line += c2.pop(0)+" " |
|
|
|
if len(c3) > 0: line += c3.pop(0)+" " |
|
|
|
print(line) |
|
|
|
|
|
|
|
# array padding |
|
|
|
for count in range(3-(len(cal_prints)%3)): |
|
|
|
cal_prints.append([]) |
|
|
|
|
|
|
|
# finally, print the fucking calendar |
|
|
|
for cal in range(0,len(cal_prints),3): |
|
|
|
printlines(cal_prints[cal],cal_prints[cal+1],cal_prints[cal+2]) |
|
|
|
|