Git Product home page Git Product logo

Comments (9)

keiffster avatar keiffster commented on July 19, 2024 1

License Key File is just a text file of key value pairs

key = value

Call it anything you like, such as licenses.keys and in the config file reference as part of the bot settings. e.g

bot:
license_keys: $BOT_ROOT/config/license.keys

from program-y.

vladimirmyshkovski avatar vladimirmyshkovski commented on July 19, 2024

Found out in the logs that it was necessary to call him METOFFICE_API_KEY

from program-y.

keiffster avatar keiffster commented on July 19, 2024

You can always check the Wiki

https://github.com/keiffster/program-y/wiki/Met-Officer-Weather-API

from program-y.

vladimirmyshkovski avatar vladimirmyshkovski commented on July 19, 2024

Despite this, I get an error.

23427 raise Exception ("No valid license key METOFFICE_API_KEY found")
23428 Exception: No valid license key METOFFICE_API_KEY found

in keys.py:

    def has_key(self, name):
        print(name)
        print(self._keys)
        return bool(name in self._keys)

output:

GOOGLE_LATLONG
{}
GOOGLE_MAPS_DISTANCE
{}
GOOGLE_MAPS_DIRECTIONS
{}
METOFFICE_API_KEY
{}

license.keys:
METOFFICE_API_KEY = 33332342-zxcas-dasdzxc-324234-4808a970995c

It looks like the file is loading after if __name__ == '__main__': in the metoffice.py
`

from program-y.

keiffster avatar keiffster commented on July 19, 2024

Ok, just be sure, can you remove the spaces around the '=',
My license key file is exactly like that
METOFFICE_API_KEY=XXXXXXXXXX
And is references from config.yaml as
bot:
license_keys: $BOT_ROOT/config/license.keys
The other check is therefore to check its in the right location
You can check the log file to see if its reporting an error

from program-y.

vladimirmyshkovski avatar vladimirmyshkovski commented on July 19, 2024

@keiffster I checked with spaces and without. And I am sure that this is not the case.

If I understand the problem correctly, load_license_key_file is called only after if __name__ == '__main__' :, and since this file is not executable in this situation, the function can not be called.

Or am I mistaken in how it works if __name__ == '__main__':?

from program-y.

keiffster avatar keiffster commented on July 19, 2024

from program-y.

vladimirmyshkovski avatar vladimirmyshkovski commented on July 19, 2024

In the /y-bot/ I run python3 ../../src/programy/clients/console.py --config ./config.yaml --cformat yaml --logging ./logging.yaml

Just tried, y-bot.sh the result is the same

It is important not to confuse the file name, and it seems that the file does not get into the githivor, so you need to create it directly on the server.

from program-y.

keiffster avatar keiffster commented on July 19, 2024

Hi is this still an issue ?

from program-y.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.