Skip to content

Commit

Permalink
Hammond Party
Browse files Browse the repository at this point in the history
  • Loading branch information
panzertime committed Dec 13, 2023
1 parent e9db65c commit 0106dfb
Show file tree
Hide file tree
Showing 15 changed files with 66 additions and 56 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# extra stuff

*.DS_Store
.vscode/
experimental/
notes.md
variables

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# esoteric-time
Esoteric Clock

Right now this just tells you whether the Age of Aquarius is dawning or not. I'll merge it with the [osam-clock](https://github.com/panzertime/osam-clock) at some point.
This is a little toy that tells you the time using an [osam-clock](https://github.com/panzertime/osam-clock) and also lets you know when the Age of Aquarius occurs.
Binary file added hammond_aquarius.mp3
Binary file not shown.
2 changes: 1 addition & 1 deletion py2app/esoteric_time/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .application import *
from .astrologer import *
from .astrology import *
from .mechanics import *
from .presentations import *
15 changes: 6 additions & 9 deletions py2app/esoteric_time/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def run():
root.title = "O.S. Anno Mundi"
root.resizable(False,False)
root.wm_attributes("-topmost", True)
print("made root")
# print("made root")

mainFrame = tk.Frame(root, padx=5, pady=5)
mainFrame.pack()
Expand All @@ -51,27 +51,24 @@ def run():
calendarFrame.pack(fill="x")
calendar = OsamCalendar(calendarFrame)
calendar.pack()
print("made calendar")
# print("made calendar")

astrologyFrame = tk.Frame(mainFrame, relief="groove", borderwidth=2)
astrologyFrame.pack(fill="x")
astrologer = Astrologer(astrologyFrame)
astrologer.pack()
print("made astrologer")
# print("made astrologer")

calendar.write()
print("wrote calendar")
# print("wrote calendar")
astrologer.augur()
print("augured")
# print("augured")

menubar = tk.Menu(root)
Timemenu = tk.Menu(menubar, tearoff=0)
Timemenu.add_command(label="Simulate Aquarius", command=lambda: astrologer.dawnAquarius())
Timemenu.add_checkbutton(label="Hammond Party", command=lambda: astrologer.getHip())
menubar.add_cascade(label="Time", menu=Timemenu)

root.config(menu=menubar)
root.mainloop()

print("main loop started")


File renamed without changes.
Binary file added py2app/esoteric_time/hammond_aquarius.mp3
Binary file not shown.
38 changes: 21 additions & 17 deletions py2app/esoteric_time/presentations.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from playsound import playsound

from . import astrologer
from . import astrology
from . import *

def romanize(input):
Expand Down Expand Up @@ -34,22 +34,22 @@ def __init__(self, master=None):
self.contents.set(self.getDate())

def write(self):
print("writing Calendar")
# print("writing Calendar")
self.config(textvariable=self.contents)
self.contents.set(self.getDate())
self.after(1000, self.write)
print("wrote Calendar")
# print("wrote Calendar")

def getDate(self):
print("getting Date")
# print("getting Date")
julian = datetime.today() - timedelta(days = 13)

year = julian.year + 5508
if julian.month > 8:
year += 1
date_string = str(julian.day) + " / " + romanize(julian.month) + " / " + str(year)
time_string = str(julian.hour - 12 if julian.hour > 12 else (12 if julian.hour == 0 else julian.hour)) + " : " + str(julian.minute).zfill(2) + " : " + str(julian.second).zfill(2) + (" PM" if julian.hour > 11 else " AM")
print("got Date")
# print("got Date")
return date_string + "\n" + time_string

class Astrologer(tk.Frame):
Expand Down Expand Up @@ -89,11 +89,12 @@ def __init__(self, master=None):

self.philosophyCounter = 0
self.isAquarius = False
self.uncool = True

self.aquariusFrame.pack_forget()

def dawnAquarius(self):
print("DAWN CALLED")
# print("DAWN CALLED")
self.aquariusFrame.pack()
self.isAquarius = True

Expand All @@ -102,43 +103,46 @@ def dawnAquarius(self):
# Thread(target=playsound, args=[sound]).start()

# does seem to work with py2app:
sound = environ["RESOURCEPATH"] + "/aquarius.mp3"
sound = environ["RESOURCEPATH"] + ("/aquarius.mp3" if self.uncool else "/hammond_aquarius.mp3")
Thread(target=playsound, args=[sound]).start()

# does not work right:
#path = Path(resources.files(package="esoteric_time")).parents[2] / 'aquarius.mp3'
#print(str(path))
# print(str(path))
#Thread(target=playsound, args=[str(path)]).start()
self.waxEloquent()
print("waxed eloquent")
# print("waxed eloquent")

def sunsetAquarius(self):
self.aquariusFrame.pack_forget()
self.isAquarius = False

def waxEloquent(self):
print("waxing eloquent")
# print("waxing eloquent")
if self.philosophyCounter == 3:
self.philosophyCounter = 0
line = astrologer.PHILOSOPHY[self.philosophyCounter]
line = astrology.PHILOSOPHY[self.philosophyCounter]
self.aquariusPhilosophy.configure(text=line)
self.philosophyCounter += 1
if self.isAquarius:
self.after(2500, self.waxEloquent)

def augur(self):
alignment = astrologer.alignmentToAngular(astrologer.computeCurrentAlignment())
print(str(alignment))
alignment = astrology.alignmentToAngular(astrology.computeCurrentAlignment())
# print(str(alignment))
self.moonHouseBox.config(state="normal")
self.moonHouse.set(romanize(alignment.moonHouse))
self.moonHouseBox.config(state="readonly")
self.planetaryAngleBox.config(state="normal")
self.planetaryAngle.set(angleFormat(alignment.jupiterMarsAngle))
self.planetaryAngleBox.config(state="readonly")
if (not self.isAquarius) and astrologer.isMomentAquarian(alignment):
print("DAWNING IN AUGUR")
if (not self.isAquarius) and astrology.isMomentAquarian(alignment):
# print("DAWNING IN AUGUR")
self.dawnAquarius()
elif self.isAquarius and (not astrologer.isMomentAquarian(alignment)):
print("SUNSET IN AUGUR")
elif self.isAquarius and (not astrology.isMomentAquarian(alignment)):
# print("SUNSET IN AUGUR")
self.sunsetAquarius()
self.after(60000, self.augur)

def getHip(self):
self.uncool = not self.uncool
2 changes: 1 addition & 1 deletion py2app/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from setuptools import setup

APP = ['myApp.py']
DATA_FILES = ['esoteric_time/aquarius.mp3']
DATA_FILES = ['esoteric_time/aquarius.mp3', 'esoteric_time/hammond_aquarius.mp3']
OPTIONS = {
'iconfile': 'digital-clock.icns'
}
Expand Down
2 changes: 1 addition & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .application import *
from .astrologer import *
from .astrology import *
from .mechanics import *
from .presentations import *
15 changes: 6 additions & 9 deletions src/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def run():
root.title = "O.S. Anno Mundi"
root.resizable(False,False)
root.wm_attributes("-topmost", True)
print("made root")
# print("made root")

mainFrame = tk.Frame(root, padx=5, pady=5)
mainFrame.pack()
Expand All @@ -51,27 +51,24 @@ def run():
calendarFrame.pack(fill="x")
calendar = OsamCalendar(calendarFrame)
calendar.pack()
print("made calendar")
# print("made calendar")

astrologyFrame = tk.Frame(mainFrame, relief="groove", borderwidth=2)
astrologyFrame.pack(fill="x")
astrologer = Astrologer(astrologyFrame)
astrologer.pack()
print("made astrologer")
# print("made astrologer")

calendar.write()
print("wrote calendar")
# print("wrote calendar")
astrologer.augur()
print("augured")
# print("augured")

menubar = tk.Menu(root)
Timemenu = tk.Menu(menubar, tearoff=0)
Timemenu.add_command(label="Simulate Aquarius", command=lambda: astrologer.dawnAquarius())
Timemenu.add_checkbutton(label="Hammond Party", command=lambda: astrologer.getHip())
menubar.add_cascade(label="Time", menu=Timemenu)

root.config(menu=menubar)
root.mainloop()

print("main loop started")


Binary file added src/aquarius.mp3
Binary file not shown.
File renamed without changes.
Binary file added src/hammond_aquarius.mp3
Binary file not shown.
38 changes: 21 additions & 17 deletions src/presentations.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from playsound import playsound

from . import astrologer
from . import astrology
from . import *

def romanize(input):
Expand Down Expand Up @@ -34,22 +34,22 @@ def __init__(self, master=None):
self.contents.set(self.getDate())

def write(self):
print("writing Calendar")
# print("writing Calendar")
self.config(textvariable=self.contents)
self.contents.set(self.getDate())
self.after(1000, self.write)
print("wrote Calendar")
# print("wrote Calendar")

def getDate(self):
print("getting Date")
# print("getting Date")
julian = datetime.today() - timedelta(days = 13)

year = julian.year + 5508
if julian.month > 8:
year += 1
date_string = str(julian.day) + " / " + romanize(julian.month) + " / " + str(year)
time_string = str(julian.hour - 12 if julian.hour > 12 else (12 if julian.hour == 0 else julian.hour)) + " : " + str(julian.minute).zfill(2) + " : " + str(julian.second).zfill(2) + (" PM" if julian.hour > 11 else " AM")
print("got Date")
# print("got Date")
return date_string + "\n" + time_string

class Astrologer(tk.Frame):
Expand Down Expand Up @@ -89,11 +89,12 @@ def __init__(self, master=None):

self.philosophyCounter = 0
self.isAquarius = False
self.uncool = True

self.aquariusFrame.pack_forget()

def dawnAquarius(self):
print("DAWN CALLED")
# print("DAWN CALLED")
self.aquariusFrame.pack()
self.isAquarius = True

Expand All @@ -102,43 +103,46 @@ def dawnAquarius(self):
# Thread(target=playsound, args=[sound]).start()

# does seem to work with py2app:
sound = environ["RESOURCEPATH"] + "/aquarius.mp3"
sound = environ["RESOURCEPATH"] + ("/aquarius.mp3" if self.uncool else "/hammond_aquarius.mp3")
Thread(target=playsound, args=[sound]).start()

# does not work right:
#path = Path(resources.files(package="esoteric_time")).parents[2] / 'aquarius.mp3'
#print(str(path))
# print(str(path))
#Thread(target=playsound, args=[str(path)]).start()
self.waxEloquent()
print("waxed eloquent")
# print("waxed eloquent")

def sunsetAquarius(self):
self.aquariusFrame.pack_forget()
self.isAquarius = False

def waxEloquent(self):
print("waxing eloquent")
# print("waxing eloquent")
if self.philosophyCounter == 3:
self.philosophyCounter = 0
line = astrologer.PHILOSOPHY[self.philosophyCounter]
line = astrology.PHILOSOPHY[self.philosophyCounter]
self.aquariusPhilosophy.configure(text=line)
self.philosophyCounter += 1
if self.isAquarius:
self.after(2500, self.waxEloquent)

def augur(self):
alignment = astrologer.alignmentToAngular(astrologer.computeCurrentAlignment())
print(str(alignment))
alignment = astrology.alignmentToAngular(astrology.computeCurrentAlignment())
# print(str(alignment))
self.moonHouseBox.config(state="normal")
self.moonHouse.set(romanize(alignment.moonHouse))
self.moonHouseBox.config(state="readonly")
self.planetaryAngleBox.config(state="normal")
self.planetaryAngle.set(angleFormat(alignment.jupiterMarsAngle))
self.planetaryAngleBox.config(state="readonly")
if (not self.isAquarius) and astrologer.isMomentAquarian(alignment):
print("DAWNING IN AUGUR")
if (not self.isAquarius) and astrology.isMomentAquarian(alignment):
# print("DAWNING IN AUGUR")
self.dawnAquarius()
elif self.isAquarius and (not astrologer.isMomentAquarian(alignment)):
print("SUNSET IN AUGUR")
elif self.isAquarius and (not astrology.isMomentAquarian(alignment)):
# print("SUNSET IN AUGUR")
self.sunsetAquarius()
self.after(60000, self.augur)

def getHip(self):
self.uncool = not self.uncool

0 comments on commit 0106dfb

Please sign in to comment.