#!/usr/bin/env python

from nodes import Node
import datetime
import time

class Time(Node):
    char = "C"
    args = 0
    results = 0
    default_arg = 0
    datetime_attrs = ["second",
                      "minute",
                      "hour",
                      "day",
                      "month",
                      "year",
                      "2dyear"]
    date_attrs = ["weekday"]

    months = ["PADDING",
              "January",
              "February",
              "March",
              "April",
              "May",
              "June",
              "July",
              "August",
              "September",
              "October",
              "November",
              "December"]
    
    contents = ["Monday",
                "Tuesday",
                "Wednesday",
                "Thursday",
                "Friday",
                "Saturday",
                "Sunday"]
    
    def __init__(self, methods: Node.NumericLiteral):
        self.methods = [int(i)for i in str(methods)]
        self.results = len(self.methods)
        
    
    def func(self):
        date_time = datetime.datetime.now()
        rtn = []
        for meth in self.methods:
            added = False
            if meth == 0:
                added = True
                print(time.time())
                rtn.append(time.time())
            meth -= 1
            if not added and meth < len(self.date_attrs):
                added = True
                rtn.append(getattr(date_time.date(), self.date_attrs[meth])())
            meth -= len(self.date_attrs)
            if not added and meth < len(self.datetime_attrs):
                added = True
                if self.datetime_attrs[meth] == "2dyear":
                    rtn.append(date_time.year%100)
                else:
                    rtn.append(getattr(date_time, self.datetime_attrs[meth]))
            
            if not added:
                rtn.append(self.months)
        return rtn
@@ -148,17 +148,18 @@
 t_arg = 
-0
+-1
 %0A    dat
@@ -394,16 +394,49 @@
 weekday%22
+,%0A                  %22isocalendar%22
 %5D%0A%0A    m
@@ -999,16 +999,133 @@
 teral):%0A
+        if methods == -1:%0A            self.func = lambda: time.time()%0A            self.results = 1%0A        else:%0A    
         
@@ -1169,16 +1169,20 @@
 thods)%5D%0A
+    
         
@@ -1373,160 +1373,8 @@
 lse%0A
-            if meth == 0:%0A                added = True%0A                print(time.time())%0A                rtn.append(time.time())%0A            meth -= 1%0A
     

Update clock - default to return milliseconds past epoch Add isocalender output to clock