Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am clueless as to how to impliment this. Think I did it right but get the following error. #4

Open
EyonB opened this issue Nov 17, 2023 · 0 comments

Comments

@EyonB
Copy link

EyonB commented Nov 17, 2023

Not sure if how to make use of this.

Installed with pip.

Just copied your script:

import os
import tempfile

from apc_smartconnect import APCSmartConnect

cookies_temp = tempfile.NamedTemporaryFile()
apc = APCSmartConnect()
apc.login(os.getenv('APC_USER'), os.getenv('APC_PASS'))

def test_gateways():
gateways = apc.gateways()
assert type(gateways) == list
assert type(gateways[0]) == str

I get the following error:

Exception ignored in: <function APCSmartConnect.del at 0x000001FB10D20AE0>
Traceback (most recent call last):
File "C:\Users\EyonB\AppData\Local\Programs\Python\Python312\Lib\site-packages\apc_smartconnect\APCSmartConnect.py", line 42, in del
self.cookies.save()
^^^^^^^^^^^^
AttributeError: 'APCSmartConnect' object has no attribute 'cookies'
Traceback (most recent call last):
File "F:\Programming\Python\APC\APC.py", line 7, in
apc = APCSmartConnect()
TypeError: APCSmartConnect.init() missing 1 required positional argument: 'cookie_file'

Not really sure how to get around this. Now I'm assuming I could add a file and path to apc = APCSmartConnect( file and path) but as to what type of file to create and link is a bit foreign to me.

Not a programmer per se but trying to make use of this for collecting some data metrics.

Any help would be greatly appreciated.

Eyon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant