Author Topic: Level nearly completed ...  (Read 46872 times)

Fabrice

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Level nearly completed ...
« on: October 30, 2015, 04:46:46 AM »
Dear Macpod and all others Lasershark Aficionados !

I have finally succeed in making my green laser projector based on lasershark working really fine under Ubuntu 14.04 ! Thank you very much for all the support that the macpod.net website is offering ...
I would like to go one step further and, sorry for that, i will need your help once again  :)

2 questions haunt me...

-1- I'm totally newbie in the programmation field, I'm starting to learn Python but i'm very curious if discovering the 'tweet.py' application. I have tried to compile it but it does not run properly . Have I miss something ?

-2- I have installed VMplayer under Windows and runs a 10.04 Ubuntu version in order to be able to discover  the Jeremy van Grinsven project (https://github.com/jv4779/openlase-mame).The main problem is that Ubuntu 10.04 is the last version of Ubuntu which has Xmame. When trying to install jackd2 library 
via "sudo apt-get install libjack-jackd2-dev" system answers that it does not exist ...
I do not want to update the Ubuntu Version because i would then lost the possibility of Xmame ... May I ask you how i should proceed please ?

Thank you very much for your help and your patience? Sorry for writing such a long post  ;)

Have a great day

PS. Can't wait for the laserShark RGB Version ...

Macpod

  • Administrator
  • Full Member
  • *****
  • Posts: 179
  • Karma: +3/-0
    • View Profile
Re: Level nearly completed ...
« Reply #1 on: October 30, 2015, 10:40:45 PM »
Hi Fabrice,

Glad you got your projector working to your liking.


1. This question is very difficult to answer without output to identify the problem you are encountering.

2. jv4779 modified xmame to support OpenLase. By default Xmame does not support OpenLase. You are going to have to compile jv4779's code.

A fair warning: I did this a while ago and even with proper 30kpps galvos, it was quite choppy and probably overly-complicated for a galvo system. I don't know or have access to many ROMs, but if you do experiment, do so with very simple games like asteroids.

Fabrice

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: Level nearly completed ...
« Reply #2 on: November 02, 2015, 03:03:37 AM »
Dear Macpod,

Thank you for your fast answer , sorry to be such a lamer but it seems that I have everything to learn ...

May I abuse from your patience once again please ?

1° I have installed the python wrapper for the twitter API. I have done it via
 'sudo easy_install python-twitter'

Then, under the terminel,
'python twitter.py'

The python compiler returns

Traceback (most recent call last):
  File "tweet.py", line 114, in <module>
    search = sys.argv[1]
IndexError: list index out of range


From this point i really need help  ;) i'm trying to learn python but not fast enough it seems ...

2° I understand that Xmame does not natively support Openlase, the main problem comes from the fact that the Xmame package is no more available under the last version of Ubuntu . I do not know how to compile the jv4779's sources under Ubuntu 14.04. jv4779 wrote in the GitHub that Ubuntu 10.04 was the last Ubuntu version with Xmame. I have tried to install openlase under Ubuntu 10.04 (VM player) but the jackd2 library is not available under this ubuntu version  :'(

May I ask you if you remember how you had proceed for compiling the jv4779's sources please ? 

Thank you very much for your help Macpod and sorry to be painful...

« Last Edit: November 03, 2015, 11:45:32 AM by Fabrice »

Macpod

  • Administrator
  • Full Member
  • *****
  • Posts: 179
  • Karma: +3/-0
    • View Profile
Re: Level nearly completed ...
« Reply #3 on: November 06, 2015, 01:30:17 AM »
Lets start on question 1. Please read through this fully because there are multiple problems here:

a. 'sudo easy_install python-twitter'
This is not actually the twitter library used by openlase, instead this one is just called "twitter"

I would suggest using pip vs easy_install to install packages:
sudo pip install twitter

b. 'python tweet.py'
This is not the correct usage. You need to specify a twitter search term. This is why you are getting this error:
Traceback (most recent call last):
  File "tweet.py", line 114, in <module>
    search = sys.argv[1]
IndexError: list index out of range

Try running it as:
python tweet.py test

Since you say you want to learn more about programming check out these tutorials which talk more about parsing command line arguments:
http://www.cyberciti.biz/faq/python-command-line-arguments-argv-example/

c. Twitter no longer supports their v1 REST API so even if you did import the right modules and provide the proper command line arguments it would not work. I'll take a look at what is needed to update this tomorrow.

Down the rabbit hole! :)

Fabrice

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: Level nearly completed ...
« Reply #4 on: November 06, 2015, 06:12:21 AM »
Dear MacPod,

Thank you so much for your help, I can now stop to pull my hair  :)
I have never imagine that the command should be used as you explain... Thank for that Macpod...
I will immediately visit the link you mentionned, and, of course, i say YES to the update you propose as my level in python is increasing really very slowly  ;)

Thank you for your assistance MacPod, have a great day ...

Macpod

  • Administrator
  • Full Member
  • *****
  • Posts: 179
  • Karma: +3/-0
    • View Profile
Re: Level nearly completed ...
« Reply #5 on: November 06, 2015, 09:48:42 PM »
I have made the bare minimum changes needed to get this running again:

https://github.com/macpod/openlase/blob/master/examples/tweet.py

In order to use this you will need to make a Twitter app:
https://apps.twitter.com/app/new

Once you create this app you will need to modify the source to include your designated API Key and API Secret.

Since tweet.py was first written by marcan it seems twitter.com has exposed a streaming api. This should be used if a new version of tweet.py were to be made.

Fabrice

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: Level nearly completed ...
« Reply #6 on: November 07, 2015, 08:22:56 AM »
Hi MacPod,
That was it !
it now compiles without error , the goal is very near but please let me ask you one lasr request please ?
The execution of

"python twitter.py test"

gives back the follwing error message

'Api' object has no attribute 'search' Fetch error

I do not have any idea about what that means , it may be a mis understanding of the twitter.py program ...

Really sorry to abuse your kindness MacPod,

Have a great week end


 
« Last Edit: November 07, 2015, 12:36:55 PM by Fabrice »

Macpod

  • Administrator
  • Full Member
  • *****
  • Posts: 179
  • Karma: +3/-0
    • View Profile
Re: Level nearly completed ...
« Reply #7 on: November 07, 2015, 01:15:49 PM »
Sounds like it is using the python-twitter api vs the twitter api. You should uninstall the python-twitter api.

Fabrice

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: Level nearly completed ...
« Reply #8 on: November 07, 2015, 05:28:29 PM »
"python-twitter" has been uninstalled but i still have the same message error when executing

python tweet.py test

Do you still have an idea MacPod ?  :-\

Macpod

  • Administrator
  • Full Member
  • *****
  • Posts: 179
  • Karma: +3/-0
    • View Profile
Re: Level nearly completed ...
« Reply #9 on: November 07, 2015, 05:30:18 PM »
What version of the tweet api do you have installed?

Fabrice

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: Level nearly completed ...
« Reply #10 on: November 08, 2015, 06:04:23 AM »
MAcPod,

As you have recommended me, i have used the command

sudo pip install twitter

And I can found in

]/usr/local/lib/python2.7/dist-packages

the following files

twitter  twitter-1.17.1.dist-info

Is it what should be expected ?

Thx MacPod





« Last Edit: November 08, 2015, 06:07:11 AM by Fabrice »

Macpod

  • Administrator
  • Full Member
  • *****
  • Posts: 179
  • Karma: +3/-0
    • View Profile
Re: Level nearly completed ...
« Reply #11 on: November 08, 2015, 09:58:49 PM »
1.17.1 is correct.

The fact that it accepted the api = twitter.Twitter(...) line indicates you are using tweet vs tweet-python.. I'm not sure why this isn't working for you with the information provided.

Did you modify the python program?


Fabrice

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: Level nearly completed ...
« Reply #12 on: November 09, 2015, 02:12:13 AM »
Hi MacPod,

Sorry to bother you, I have re-installed the twitter api once again, modified the code in the following manner

# Access token
#token = ''
# Access token secret
#token_key = ''
# Consumer key
con_secret = 'myvalue'
# Consumer Secret
con_secret_key = 'myvalue'

 and i finally obtain

skappy@skappy-portable:~/Bureau/MacPod/openlase/examples$ python tweet.py test
  File "tweet.py", line 42
    def __init__(self):
      ^
IndentationError: expected an indented block


Can you please help me to understand the meaning of this error message...

May I ask you if I can try a another argument than 'test' in

python tweet.py test

Thank you very much and sorry once again  :-[
« Last Edit: November 09, 2015, 12:23:09 PM by Fabrice »

Macpod

  • Administrator
  • Full Member
  • *****
  • Posts: 179
  • Karma: +3/-0
    • View Profile
Re: Level nearly completed ...
« Reply #13 on: November 09, 2015, 09:32:19 PM »
skappy@skappy-portable:~/Bureau/MacPod/openlase/examples$ python tweet.py test
  File "tweet.py", line 42
    def __init__(self):
      ^
IndentationError: expected an indented block


Can you please help me to understand the meaning of this error message...
Python uses spacing at the start of the line to determine when code blocks start and end. It seems line 42 is improperly indented. Spaces are not considered the same as tabs. You will need to update the indentation of this line so the program can run.

https://docs.python.org/2/reference/lexical_analysis.html#indentation


May I ask you if I can try a another argument than 'test' in

python tweet.py test

Thank you very much and sorry once again  :-[
I can use whatever argument I want and it behaves the same.

If it is still installed, you should uninstall python-twitter:
pip uninstall python-twitter

Fabrice

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: Level nearly completed ...
« Reply #14 on: November 11, 2015, 01:48:01 PM »
Dear McPod,

Today is a GREAT day !!!

I think that i'm as good at photo than at programming but despite the poor quality of the photo i'm very happy to announce you that tweet.py is running fine ...I would like to thanks you very much for your help and your assistance... I can not help but look at the scrolling messages ...

I do not want to abuse your patience and kindness but may i ask one last thing please MacPod ?

May i ask you how i should proceed in order to compile the  jv4779 code please ? I would like to test asteroids game it would remind me great time  ;) I encountered difficulties with Xmame when trying to compile ... I have installed VMplayer under Windows and runs a 10.04 Ubuntu version. The main problem is that Ubuntu 10.04 is the last version of Ubuntu which has Xmame. When trying to install jackd2 library 
via "sudo apt-get install libjack-jackd2-dev" system answers that it does not exist ...

Have a great day,

Thank you for all MacPod,  :)
« Last Edit: November 12, 2015, 03:19:17 AM by Fabrice »