These are chat archives for chidea/pyTelegram

11th
Mar 2015
Sam Pfeiffer
@awesomebytes
Mar 11 2015 09:16
hello
chidea
@chidea
Mar 11 2015 14:12
hi
Yes, he's right that py3 isn't compatible with py2
but it was not to difficult to convert between
there's an official script to convert frm py2 to py3 too
many famous projects are using that script it compatible on both
to make it compatible*
Anton Grigoryev
@griganton
Mar 11 2015 14:30
hello!
Sam Pfeiffer
@awesomebytes
Mar 11 2015 14:30
hey ho!
By reading that there is an official script to port from py2 to py3 I would write it to for py2
I see the porting is affecting just some functions (print "" to print(""), raw_input to input, division returning float directly...)
and it can be automated without actually getting garbage code generated
cool!
Sam Pfeiffer
@awesomebytes
Mar 11 2015 14:36
Even so, I'm open to talk about writing it supporting Python3 from the start (so, following guidelines that will make code work on both versions, if there are)
Sam Pfeiffer
@awesomebytes
Mar 11 2015 14:44
Here is a post about writing code that will behave in both versions: http://python3porting.com/noconv.html
(which after taking a glance at it, it's way more convenient to write python2.7 code and use the 2to3 tool to generate the py3 code)
Anton Grigoryev
@griganton
Mar 11 2015 14:49
yes, it's better to try to write code supported by both versions
@awesomebytes what systems do you use that don't support python3?
chidea
@chidea
Mar 11 2015 14:51
hello! read your reply and thanks for instruct
Anton Grigoryev
@griganton
Mar 11 2015 14:52
I've devided to move from custom-syntax TL to JSON TL. It's much easier to implement and code became more understandable
Sam Pfeiffer
@awesomebytes
Mar 11 2015 14:52
My plan is to get communications with different robots (im a robotics engineer) to work with telegram
the framework used in robotics is called ROS (from Robotics Operative System) and it only supports python 2.7
(there was a plan on going to Python3 last year but they found out too many problems and for now there is no plan to move forward)
This enables cool stupid stuff like asking the robots stuff via telegram (what do you see? --> receive a real time image of a camera of the robot, i have this implemented with whatsapp, but you can't trust whatsapp as the API is unofficial and they keep changing stuff all the time)
and also enables cool stuff like communicating in safe way via any internet connection via encrypted conversations to pass messages (doing it with a custom solution is VERY cumbersome)
I also like to tinker with anything to do with gadgets and electronics, so a raspberry pi with telegram controlling your torrents and stuff is also cool (which ppl are doing with the CLI version)
and yeah the JSON TL is the way to go, parsing it is "free" just load the JSON :D
Anton Grigoryev
@griganton
Mar 11 2015 15:03
Heh, I've started with "yowsup" whatsapp api too... Not very reliable. Whatsapp has no open protocol, and reverse-engineered yowsup can stop working at every moment.
telegram is much better, but i was surprised that python-developers didn't create any python-based API.
Sam Pfeiffer
@awesomebytes
Mar 11 2015 15:05
yeah I was exactly the same surprised
I mean, usually, the first implementation of a lot of APIs is Python
xD
Anton Grigoryev
@griganton
Mar 11 2015 15:05
Only pytg project that wraps command-line client. So, it's acceptable only on desktops.
Sam Pfeiffer
@awesomebytes
Mar 11 2015 15:06
and it's a little bit of a monster what you run just to send/receive messages
Anton Grigoryev
@griganton
Mar 11 2015 15:06
Python is very popular )) OK! We decided to do it trying to keep it working on Python 2 as well as 3
chidea
@chidea
Mar 11 2015 15:06
hmm.. is ROS a subOS running on Ubuntu?
anyway I agree on that we shd make it work on both
Anton Grigoryev
@griganton
Mar 11 2015 15:09
First step - serializing/deserializing according to the TL-schema. Have you read the docs? It seems clear, but now I troubling how to implement it beautiful way ))
Sam Pfeiffer
@awesomebytes
Mar 11 2015 15:09
kinda @chidea, it's not really a OS, it's a huge set of tools for robotics. They implement a networking layer with publisher/subscriber and blocking and non blocking services using defined messages to pass data. It's the standard right now. It has a huuuuuuge quantity of packages working out of the box very useful for robotics
Anton Grigoryev
@griganton
Mar 11 2015 15:09
i have mindstorms at home, i like robotics =D
chidea
@chidea
Mar 11 2015 15:12
in that case, you could try nasty way like running py3 app on ubuntu and use let it make outputs like file or socket and take that with ROS
But, anyway it's not hard to make an app workable on both and agree on you guys.
Sam Pfeiffer
@awesomebytes
Mar 11 2015 15:14
my robots won't ever have py3 in them (not in the next 2 years at least) and I would like to put telegram working in them :P so that is not really a good approach for me
so yeah, we agreed on
1) Support for py2 and py3
2) Start with serializing/deserializing
I would add 3) Where do we work? griganton repo?
chidea
@chidea
Mar 11 2015 15:15
OK.
yes I like his work more than mine and if it's ok i want to.
Sam Pfeiffer
@awesomebytes
Mar 11 2015 15:15
and 4) Little plan on implementation in a README.md would be awesome
Anton Grigoryev
@griganton
Mar 11 2015 15:15
Oh, README.md is really necessary...
Sam Pfeiffer
@awesomebytes
Mar 11 2015 15:16
yeah, we should add all the info we have in it (links to the TL-schema, and relevant docs)
and our MISSION PLAN
ouh yeah
Anton Grigoryev
@griganton
Mar 11 2015 15:16
Ok, guys, how to start. You need some telegram credentials for testing purposes
Sam Pfeiffer
@awesomebytes
Mar 11 2015 15:17
I'm at work currently, I can start giving it a look tonight
Anton Grigoryev
@griganton
Mar 11 2015 15:17
I don't like to share it because it is connected to my mobile number.
Anton Grigoryev
@griganton
Mar 11 2015 15:17
Yes!
chidea
@chidea
Mar 11 2015 15:18
done before. :smile:
Anton Grigoryev
@griganton
Mar 11 2015 15:18
You need id and public keys.
I store It in the config file and use configparser module
RSA key is stored in rsa.pub file
they placed in root of repo and added to .gtignore
chidea
@chidea
Mar 11 2015 15:19
ok~
Sam Pfeiffer
@awesomebytes
Mar 11 2015 15:19
Ok, perfect :)
I have some SIM card around house for this kind of testing purposes
I can activate it on telegram and give the key as our testing platform
if we don't want to use our personal number (you know, in case we get to hack the telegram servers or something)
Anton Grigoryev
@griganton
Mar 11 2015 15:22
May be we can use different credentials?
Sam Pfeiffer
@awesomebytes
Mar 11 2015 15:23
of course, but if anyone wants, there it is
Anton Grigoryev
@griganton
Mar 11 2015 15:23
Today I'll try to put some comments on code and move the SCHEMA to JSON. It will be the point to start :)
Now my code can send request of PQ to server, get the answer and factorize the PQ number.
@awesomebytes Can you test the struct module on your ROS? It is used widely in serialization/deserialization. Does it work correctly?
chidea
@chidea
Mar 11 2015 15:26
Wow that's cool
Sam Pfeiffer
@awesomebytes
Mar 11 2015 15:28
Is there any specific test I can do to check if it works correctly?
chidea
@chidea
Mar 11 2015 15:29
May not needed to hack server but that's good to be noticed. :)
Anton Grigoryev
@griganton
Mar 11 2015 15:32
yes, testing.py included in my repo.
I need ~hour to make it work at push the first commit not only for me ))
chidea
@chidea
Mar 11 2015 15:35
take your time~ I'm having tons of things to do myself too.. got many new devices today lol
just now installed intelliJ to clone your project haha
Sam Pfeiffer
@awesomebytes
Mar 11 2015 15:40
Intellij is like PyCharm?
chidea
@chidea
Mar 11 2015 15:40
Ah, don't worry abt readme.md, I'll do it
Anton Grigoryev
@griganton
Mar 11 2015 15:40
I use PyCharm )) It is brilliant
chidea
@chidea
Mar 11 2015 15:40
yes it's the same company
Anton Grigoryev
@griganton
Mar 11 2015 15:40
Emm
I've started Readme.md
I'm newbie at Github ( I don't know how to wrk on repo in a group (
chidea
@chidea
Mar 11 2015 15:41
intelliJ has a python plugin that makes it usable as same as pyCharm
I've been writing some readme.md with github markdown thesedays
so it would be easier for me :)
Then you can push it anyway and I'll continue from there
Anton Grigoryev
@griganton
Mar 11 2015 15:42
How can we work on code togeteher? You will just push commits to this repo?
chidea
@chidea
Mar 11 2015 15:45
well, it's far more easier to cowork if we work in each own file
Sam Pfeiffer
@awesomebytes
Mar 11 2015 15:46
For fairness I would add @chidea and me to the project
and we can work as usual in github, you fork the project on your user, you work on your modifications in a branch, and you propose a Pull Request for the main repo
Everyone takes a look at the Pull Request (mainly for big things), usually giving some thumbs up :+1: and then we merge it
chidea
@chidea
Mar 11 2015 15:48
hmm it seems by default it's refusing pushes
Sam Pfeiffer
@awesomebytes
Mar 11 2015 15:48
If you haven't done it, it's very straight forward
yeah, he needs to add us as collaborators
then you can directly also push
(useful for things like updating the README.md or you spotted a mistake just after doing something)
but mainly having access to push is useful for when we get pull request of other people that are not collaborators
to be able to merge their pull requests
(believe me, once we have a little bit of this working, many people will be interested in helping)
chidea
@chidea
Mar 11 2015 15:49
yes please add us as collaborators
Anton Grigoryev
@griganton
Mar 11 2015 15:49
no problem!
done
BTW
chidea
@chidea
Mar 11 2015 15:51
cool. my little push succeed
Anton Grigoryev
@griganton
Mar 11 2015 15:51
"Please don't use the name Telegram for your app or make sure you have the word unofficial in the title."
chidea
@chidea
Mar 11 2015 15:51
oh I read that too
Anton Grigoryev
@griganton
Mar 11 2015 15:51
How can I control new pushes? )
chidea
@chidea
Mar 11 2015 15:52
you can get fetch&pull
Sam Pfeiffer
@awesomebytes
Mar 11 2015 15:52
git pull does fetch+merge
Anton Grigoryev
@griganton
Mar 11 2015 15:52
nono, I just want to know what is new in repo, just on github
chidea
@chidea
Mar 11 2015 15:52
if there's conflict, it'll be needed to merge
on web?
Anton Grigoryev
@griganton
Mar 11 2015 15:54
yes
chidea
@chidea
Mar 11 2015 15:55
you can press commits
and select a commit to it's detail change
it's right below the title
says 9 commits
right now
Anton Grigoryev
@griganton
Mar 11 2015 16:07
Clear!
Thanks
OK. Finished the README. English is not my native, so if you see any error - please feel free to push the correction ))