Author Topic: Yet Another Price Feed Mod  (Read 17194 times)

0 Members and 1 Guest are viewing this topic.

Offline kokojie

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
xeroc, why does your script lock the wallet after updating feed? the delegate needs an unlocked wallet to run?

Offline kokojie

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
i'd guess you have installed prettytable into python2 .. maybe there ia a separate pip3 or so for python3 .. else you can try easy_install3 .. dependa on your linux distribution ..

Holy shit, there's indeed a "pip3" command.  Your script now works now for me. Thanks for all your help.

Offline cube

  • Hero Member
  • *****
  • Posts: 1404
  • Bit by bit, we will get there!
    • View Profile
  • BitShares: bitcube
I'm getting a "unknown error - yahoo" now when I run the script. Anyone else getting this?

You may try this change and see if it helps.

<code>

   #yahooprices =  response.text.split( '\r\n' )
   yahooprices =  response.text.replace('\r','').split( '\n' )

</code>
ID: bitcube
bitcube is a dedicated witness and committe member. Please vote for bitcube.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
i'd guess you have installed prettytable into python2 .. maybe there ia a separate pip3 or so for python3 .. else you can try easy_install3 .. dependa on your linux distribution ..

Offline kokojie

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
xeroc, I did "pip install prettytable", and it tell me successfully installed prettytable

Then I get the same error when I run your script: No module named 'prettytable'

What did I do wrong?

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Yup .. i.stall ftom that repo .. also need prettytable ..
Read the README in bitshares-pytools too

Offline kokojie

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
You need python3!!

ok so I needed to run "python3 main.py ALL", but then I get this error:
File "main.py", line 4, in <module>
import bitsharesrpc
ImportError: No module named 'bitsharesrpc'

Do I need to install this too? https://github.com/xeroc/python-bitsharesrpc

Also, it looks like I need a "PrettyTable" module too? where do I get this.
« Last Edit: March 14, 2015, 08:14:35 pm by kokojie »

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
You need python3!!

Offline kokojie

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
Oh .. you run the script with

python main.py ALL

Will publish all prices implemented in the script

I certainly have to do more documentation on ALL my scripts .. give me some time please

I get an error after running that:
File "main.py", line 413
  print("Loading data: ", end="", flush=True)
                                                   ^
SyntaxError: invalid syntax

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Oh .. you run the script with

python main.py ALL

Will publish all prices implemented in the script

I certainly have to do more documentation on ALL my scripts .. give me some time please

Offline kokojie

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
I'm getting a "unknown error - yahoo" now when I run the script. Anyone else getting this?
I made some modifications and moved the script into bitshares-pytools on github .. please try that version

I'm using emski's script, the problem is directed at emski.

btw, I can't get your script to work, can you write some documentation on github, like where am I suppose to put the asset symbols? I don't see them in the config-example.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
I'm getting a "unknown error - yahoo" now when I run the script. Anyone else getting this?
I made some modifications and moved the script into bitshares-pytools on github .. please try that version

Offline kokojie

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
I'm getting a "unknown error - yahoo" now when I run the script. Anyone else getting this?

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
EDIT: Just to note that currently bter returns an error so it is ignored by the script anyway
unless you set it to >0.7 or then the script will stop .. at least my implementation

Offline emski

  • Hero Member
  • *****
  • Posts: 1282
    • View Profile
    • http://lnkd.in/nPbhxG
I recommend every delegate to set bter_trust_level to 0.0 in the config file

Given the recent events this might be a good idea.
Delegates are free to modify the configuration as they see need for it.

EDIT: Just to note that currently bter returns an error so it is ignored by the script anyway
« Last Edit: February 15, 2015, 05:56:08 pm by emski »