Running TWBlue from sources

Some people in Twitter have started to use TWBlue from the source code. It means that they are getting the sources as soon as they receive new changes or updates, and running the TWBlue version with these changed bits of code. I have been asked to provide the “official” guide for using TWBlue from sources, and even if I don’t recommend this for everyone, here are the “guide”.

Why you may want to run TWBlue from sources?

TWBlue is free software. Its source code is widely available and you can use the program by running it from sources, as we do every day. Some people started to run the program from its source code because they get code changes as soon as they are uploaded to the repository. That includes every new thing we are adding to the client. They just have to write a command, and they get the updated version of the source code repository. If you are wishing to try the versions of the client before anyone else, you may want to use the client from sources.

Getting git for windows

We use a tool called git for managing change sets in our repositories. If you want to install everything and get the source code changes, you should download and install git for windows from this link. This is a standard windows app, so you would be OK by following the wizard (basically press next several times and finish when it is done). Once installed, you can proceed.

Getting the files

Open the git CMD application (whether from the start menu or in your desktop) and paste the following commands:

git clone https://github.com/manuelcortez/twblue --dept=1

Note: after the above command it will download some files, so give it some time.

cd TWBlue

git submodule init

git submodule update

Installing dependencies

After these commands, there should be a directory called TWBlue in your home folder. If you open it, you will see some other directories and files, open the windows dependencies folder and install the executables located in the x86 folder (for 32 bits windows) or x64 (for 64 bits). If you have a 64 bits system, you can install both 32 and 64 bits versions of all components, but it is not needed, unless you plan to build an executable version of TWBlue. When installing Python, make sure you checked the option for adding python to the path environment variable in Windows, it will make your life much easier. These are the files you must install, the first file will be the Python version, others can be in the order that you prefer:

  • python-2.7.13
  • wxPython3.0-win32-3.0.2.0-py27
  • pywin32-220.win32-py2.7
  • pyenchant-1.6.6.win32
  • (optional, only needed if you want to build a distributable version of TWBlue) py2exe-0.6.9.win32-py2.7

Other files can be ignored.

Installing other python scripts

Open a command line (windows R and write “cmd”) and paste the following command:

easy_install -Z --upgrade six configobj goslate markdown future suds requests oauthlib requests-oauthlib requests-toolbelt pypubsub==3.3.0 pygeocoder arrow==0.6 python-dateutil futures winpaths PySocks win_inet_pton yandex.translate

Once installed, everything is ready for running TWBlue.

Running TWBlue from sources

Go to the TWBlue folder by opening it in the windows Explorer, open the src directory, and locate the file called main.py. Press the applications key there and select “open with Python”, if it’s not the first option. And everything should be done, TWBlue will be opened from the source code.

Getting updates

If you follow the TWBlue account in twitter, you should know that I tend to post every update that we send to the official repository. Every time you see these updates, you can apply them to the currently code that you have. You will need git for syncing these changes, so don’t remove it. Here are the steps for updating your version of the source code. Of course if you are using TWBlue from source, you will need to close the program, apply the updates to the source code, and open it again.

Open git CMD from the start menu or desktop, depending in your particular case.

Type the following commands:

cd TWBlue

git pull

You should see a list of updated files, or the message “already up to date” otherwise. And that’s all, you’ve updated the client and you can open it again for seeing the new added changes.

Credits

I have made this tutorial by following the TWBlue readme instructions and by modifying a tutorial created by @AnimalMetal. If you find issues when running TWBlue from sources, you can drop me a mention or direct message in twitter @tw_blue2) and we’ll try to help.