Exemplo n.º 1
0
    def build(self):
        diaSem = str(bsn.n2d(int(time.strftime("%w"))))
        diaMes = str(bsn.d2w(int(time.strftime("%d"))))
        mes = str(bsn.n2m(int(time.strftime("%m"))))

        now = diaSem + ' ' + diaMes + ' de ' + mes + ',' + time.strftime(
            " %I %M %p")

        if int(time.strftime("%H")) < 12:
            period = 'os dias '
        if int(time.strftime("%H")) >= 12:
            period = 'as tardes '
        if int(time.strftime("%H")) >= 17:
            period = 'as noches '

        # reads out good morning + my name
        gmt = 'Buen' + period

        # reads date and time
        day = ' Hoy es ' + now + '.  '

        greeting = gmt + self.sconfig['name'] + ' , ' + day

        if self.debug:
            print greeting

        self.content = greeting
Exemplo n.º 2
0
  def build(self):
    diaSem=str(bsn.n2d(int(time.strftime("%w"))))
    diaMes=str(bsn.d2w(int(time.strftime("%d"))))
    mes=str(bsn.n2m(int(time.strftime("%m"))))

    now = diaSem + ' ' +  diaMes + ' de ' + mes + ',' + time.strftime(" %I %M %p")

    if int(time.strftime("%H")) < 12:
      period = 'os dias '
    if int(time.strftime("%H")) >= 12:
      period = 'as tardes '
    if int(time.strftime("%H")) >= 17:
      period = 'as noches '

    # reads out good morning + my name
    gmt = 'Buen' + period

    # reads date and time 
    day = ' Hoy es ' + now + '.  '

    greeting = gmt + self.sconfig['name'] + ' , ' + day

    if self.debug:
      print greeting

    self.content = greeting
Exemplo n.º 3
0
    def build(self):
        day_of_month = str(bsn.d2w(int(time.strftime("%d"))))

        now = time.strftime("%A %B ") + day_of_month + ',' + time.strftime(
            " %I %M %p")

        if int(time.strftime("%H")) < 12:
            period = 'morning'
        if int(time.strftime("%H")) >= 12:
            period = 'afternoon'
        if int(time.strftime("%H")) >= 17:
            period = 'evening'

        # reads out good morning + my name
        gmt = 'Good ' + period + ', '

        # reads date and time
        day = '! It is ' + now + '.  '

        greeting = gmt + self.sconfig['name'] + day

        if self.debug:
            print greeting

        self.content = greeting
Exemplo n.º 4
0
    def build(self):
        day_of_month = str(bsn.d2w(int(time.strftime("%d"))))

        now = time.strftime("%A %B ") + day_of_month + ',' + time.strftime(
            " %I %M %p")

        if int(time.strftime("%H")) < 12:
            period = 'os días'
        if int(time.strftime("%H")) >= 12:
            period = 'as tardes'
        if int(time.strftime("%H")) >= 20:
            period = 'as noches'

        # reads out good morning + my name
        gmt = 'Buen' + period + ', '

        # reads date and time
        day = ' es ' + now + '.  '

        greeting = gmt + self.sconfig['name'] + day

        if self.debug:
            print greeting

        self.content = greeting
Exemplo n.º 5
0
  def build(self):
    day_of_month=str(bsn.d2w(int(time.strftime("%d"))))

    now = time.strftime("%A %B ") + day_of_month + ',' + time.strftime(" %I %M %p")

    if int(time.strftime("%H")) < 12:
      period = 'morning'
    if int(time.strftime("%H")) >= 12:
      period = 'afternoon'
    if int(time.strftime("%H")) >= 17:
      period = 'evening'

    # reads out good morning + my name
    gmt = 'Good ' + period + ', '

    # reads date and time 
    day = ' it\'s ' + now + '.  '

    greeting = gmt + self.sconfig['name'] + day

    if self.debug:
      print greeting

    self.content = greeting
Exemplo n.º 6
0
#!/bin/python
# -*- coding: utf-8 -*-
import time
import better_spoken_numbers as bsn
import ConfigParser

Config = ConfigParser.ConfigParser()
try:
    Config.read('/home/pi/Scripts/talkingPi/alarm.config')
except:
    raise Exception('Sorry, Failed reading alarm.config file.')

day_of_month = str(bsn.d2w(int(time.strftime("%d"))))

now = time.strftime("%A %B ") + day_of_month + ',' + time.strftime(" %I %M %p")
# print now

if int(time.strftime("%H")) < 12:
    period = 'morning'
if int(time.strftime("%H")) >= 12:
    period = 'afternoon'
if int(time.strftime("%H")) >= 18:
    period = 'evening'

#print time.strftime("%H")
#print period

# reads out good morning + my name
gmt = 'Good ' + period + ' '

# reads date and time
Exemplo n.º 7
0
#!/bin/python
# -*- coding: utf-8 -*-
import time
import better_spoken_numbers as bsn
import ConfigParser

Config=ConfigParser.ConfigParser()
try:
  Config.read('/home/pi/anothalarmpi/alarm.config')
except:
  raise Exception('Sorry, Failed reading alarm.config file.')

day_of_month=str(bsn.d2w(int(time.strftime("%d"))))

now = time.strftime("%A %B ") + day_of_month + ',' + time.strftime(" %I %M %p")
# print now


if int(time.strftime("%H")) < 12:
  period = 'morning'
if int(time.strftime("%H")) >= 12:
  period = 'afternoon'
if int(time.strftime("%H")) >= 17:
  period = 'evening'

#print time.strftime("%H")
#print period

# reads out good morning + my name
gmt = 'Good ' + period + ', '