made date cruncher
fixed autistic backslash to normal human beings backslash
This commit is contained in:
34
twintgui.py
34
twintgui.py
@@ -23,15 +23,31 @@ backslash = '\\'
|
|||||||
#Nvm its Qt Creator thats big dumb why tf is tab just a bunch of spaces wtf
|
#Nvm its Qt Creator thats big dumb why tf is tab just a bunch of spaces wtf
|
||||||
|
|
||||||
#Date Transformation Function
|
#Date Transformation Function
|
||||||
def date_cruncher(Weekday,month,day,year):
|
date_dic= {
|
||||||
if (month != 'Jan'):
|
'Jan':'1',
|
||||||
pass month = '1'
|
'Feb':'2',
|
||||||
|
'Mar':'3',
|
||||||
|
'Apr':'4',
|
||||||
|
'May':'5',
|
||||||
|
'Jun':'6',
|
||||||
|
'Jul':'7',
|
||||||
|
'Aug':'8',
|
||||||
|
'Sep':'9',
|
||||||
|
'Oct':'10',
|
||||||
|
'Nov':'11',
|
||||||
|
'Dec':'12'
|
||||||
|
}
|
||||||
|
|
||||||
|
def date_cruncher(bad_date):
|
||||||
|
good_date_list = bad_date.split()
|
||||||
|
good_date_day = good_date_list[2]
|
||||||
|
good_date_month = date_dic[good_date_list[1]]
|
||||||
|
good_date_year = good_date_list[3]
|
||||||
|
good_date = good_date_year + '-' + good_date_month + '-' + good_date_day
|
||||||
|
|
||||||
|
|
||||||
date = day + month + year
|
|
||||||
print("I crunched the date!")
|
print("I crunched the date!")
|
||||||
print(date)
|
print(good_date)
|
||||||
|
return(good_date)
|
||||||
|
|
||||||
|
|
||||||
def tweet_search():
|
def tweet_search():
|
||||||
@@ -56,8 +72,8 @@ def tweet_search():
|
|||||||
c.Popular_tweets = window.Popular.checkState()
|
c.Popular_tweets = window.Popular.checkState()
|
||||||
c.Output = filename
|
c.Output = filename
|
||||||
c.timedelta = '2'
|
c.timedelta = '2'
|
||||||
c.Since = window.Since.date().toString()
|
c.Since = date_cruncher(window.Since.date().toString())
|
||||||
c.Until = window.Until.date().toString()
|
c.Until = date_cruncher(window.Until.date().toString())
|
||||||
|
|
||||||
#c.Username =
|
#c.Username =
|
||||||
|
|
||||||
@@ -71,7 +87,7 @@ app = QtWidgets.QApplication(sys.argv)
|
|||||||
|
|
||||||
window = loader.load("mainwindow.ui", None)
|
window = loader.load("mainwindow.ui", None)
|
||||||
|
|
||||||
#window.SearchButton.clicked.connect(date_cruncher)
|
|
||||||
window.SearchButton.clicked.connect(tweet_search)
|
window.SearchButton.clicked.connect(tweet_search)
|
||||||
print(window.Since.date().toString())
|
print(window.Since.date().toString())
|
||||||
print(window.Until.date().toString())
|
print(window.Until.date().toString())
|
||||||
|
|||||||
Reference in New Issue
Block a user