Skip to content

Instantly share code, notes, and snippets.

@iquiw
Created February 22, 2014 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iquiw/9156790 to your computer and use it in GitHub Desktop.
Save iquiw/9156790 to your computer and use it in GitHub Desktop.
Turpial install instruction for Windows

Turpial install instruction for Windows

Prerequisite

  1. Python2.7 is installed (Python2.7.6)
  2. pip is installed. (pip)
  3. libturpial and Turpial Git repositories are cloned and development branch is checked out.

Installation Step

  1. Install PyQt4 binary by installer (PyQt4-4.10.3-gpl-Py2.7-Qt4.8.5)
  2. Install Babel and Jinja2 by pip:

    > pip install babel
    > pip install jinja2
  3. Modify libturpial/setup.py to avoid error while install.
--- a/setup.py
+++ b/setup.py
@@ -18,7 +18,7 @@ protocol. This library is the backend used for Turpial.
 """

 data_files=[
-    ('./', ['ChangeLog', 'AUTHORS', 'COPYING']),
+    ('.', ['ChangeLog', 'AUTHORS', 'COPYING']),
 ]

 setup(name="libturpial",
  1. Modify Turpial/turpial/ui/qt/webview.py to correct image paths for Windows (This is a hack!)
diff --git a/turpial/ui/qt/webview.py b/turpial/ui/qt/webview.py
index bb8c8d2..a1f2ca9 100644
--- a/turpial/ui/qt/webview.py
+++ b/turpial/ui/qt/webview.py
@@ -61,7 +61,7 @@ class StatusesWebView(QWebView):
         return Template(content)

     def __load_stylesheet(self):
-        attrs = {
+        attrs = { k: '/' + v.replace('\\', '/') for k, v in {
             'mark_protected': os.path.join(self.base.images_path, 'mark-protected.png'),
             'mark_favorited': os.path.join(self.base.images_path, 'mark-favorited2.png'),
             'mark_repeated': os.path.join(self.base.images_path, 'mark-repeated2.png'),
@@ -79,7 +79,7 @@ class StatusesWebView(QWebView):
             'action_favorite_shadowed': os.path.join(self.base.images_path, 'action-favorite-shadowed.png'),
             'action_delete': os.path.join(self.base.images_path, 'action-delete.png'),
             'action_delete_shadowed': os.path.join(self.base.images_path, 'action-delete-shadowed.png'),
-        }
+        }.items() }
         stylesheet = self.__load_template('style.css')
         return stylesheet.render(attrs)
  1. Install libturpial:

    > cd <somewhere>/libturipal
    > python setup.py install

    This automatically installs oauth, simplejson and requests.

  2. Install Turpial:

    > cd <somewhere>/Turipal
    > python setup.py install
@satanas
Copy link

satanas commented Mar 13, 2014

Could you explain why did you need to change the attrs dict? I mean, the os.path.join should consider different path separators according the OS. If this attr cause you an error could you post here the output so I can try to reproduce it (and identify it).

Thanks!

@telepath
Copy link

I didn't change webview.py, but had to remove spaces from paths in MAINFEST.in to get the installation running.

I can start turpial and authorize my account, but it won't load the timeline and I'm getting some errors:

Traceback (most recent call last):
  File "D:\Dev\Python27\lib\site-packages\turpial-3.5.9_dev-py2.7.egg\turpial\ui
\qt\main.py", line 667, in after_update_column
    self.os_notifications.updates(column, len(updates), filtered)
AttributeError: 'NoneType' object has no attribute 'updates'

A simmilar error at the installation was solved by removing spaces/trailing slashes from pathes at MANIFEST.in, so maybe this is a simmilar case?

@iquiw
Copy link
Author

iquiw commented Jul 20, 2014

Sorry, I have not noticed the comments till now. (I don't think I have got any notification from GitHub...)

@satanas

Could you explain why did you need to change the attrs dict?

It does not throw any error, but icons (favorite, retweet, etc.) are not displayed.
I suppose CSS (style.css) does not permit backslash as path separator.

@telepath

I can start turpial and authorize my account, but it won't load the timeline and I'm getting some errors:

I got the same error.
The workaround is to uncheck "Notifications" from Cog icon and restart Turpial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment