fixed apostroph problems on os x

This commit is contained in:
Jeena 2014-01-07 21:23:29 +01:00
parent b22ab00922
commit 81675dec77
4 changed files with 105 additions and 83 deletions

View file

@ -1,4 +1,4 @@
<img align=right src="http://jabs.nu/feedthemonkey/feedthemonkey-icon.png" width=256 alt='Icon'>
<img align=right src="http://jabs.nu/feedthemonkey/feedthemonkey-icon.png" width='256' alt='Icon'>
# Feed the Monkey

17
build-osx.sh Executable file
View file

@ -0,0 +1,17 @@
#!/bin/bash
HERE=`pwd`
TMP="/tmp"
rm -rf FeedTheMonkey.app
rm -rf $TMP/feedthemonkey
mkdir $TMP/feedthemonkey
cp Icon.icns $TMP/feedthemonkey/
cp setup.py $TMP/feedthemonkey
cp feedthemonkey $TMP/feedthemonkey/
cd $TMP/feedthemonkey
python setup.py py2app
mv $TMP/feedthemonkey/dist/FeedTheMonkey.app $HERE
cd $HERE
rm -rf $TMP/feedthemonkey
FeedTheMonkey.app/Contents/MacOS/FeedTheMonkey

View file

@ -3,6 +3,7 @@
import sys, os, json, tempfile, urllib2, urllib, json
from PyQt4 import QtGui, QtCore, QtWebKit, QtNetwork
from threading import Thread
from sys import platform as _platform
settings = QtCore.QSettings("jabs.nu", "feedthemonkey")
@ -136,6 +137,7 @@ class List(QtGui.QTableWidget):
self.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
self.app = container
self.itemSelectionChanged.connect(self.rowSelected)
self.setShowGrid(False)
def initHeader(self):
self.clear()
@ -172,7 +174,6 @@ class List(QtGui.QTableWidget):
row += 1
self.selectRow(0)
def rowSelected(self):
indexes = self.selectedIndexes()
if len(indexes) > 0:
@ -187,6 +188,7 @@ class List(QtGui.QTableWidget):
font.setBold(article["unread"])
item.setFont(font)
class Content(QtGui.QWidget):
def __init__(self, container):
QtGui.QWidget.__init__(self)
@ -302,10 +304,10 @@ class Content(QtGui.QWidget):
self.evaluateJavaScript("setArticle('empty')")
def templateString(self):
return """
<!DOCTYPE html>
<html>
<head>
html="""
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ttrssl</title>
<script type="text/javascript">
@ -336,7 +338,7 @@ class Content(QtGui.QWidget):
} else if(article) {
$("date").innerHTML = (new Date(parseInt(article.updated, 10) * 1000)).toLocaleString();
$("date").innerHTML = (new Date(parseInt(article.updated, 10) * 1000));
$("title").innerHTML = article.title;
$("title").href = article.link;
$("title").title = article.link;
@ -350,9 +352,12 @@ class Content(QtGui.QWidget):
</script>
<style type="text/css">
body {
font-family: "Ubuntu", "Lucida Grande","Tahoma";
font-family: "Ubuntu", "Lucida Grande", "Tahoma", sans-serif;
padding: 1em 2em 1em 2em;
}
body.darwin {
font-family: "LucidaGrande", sans-serif;
}
h1 {
font-weight: normal;
margin: 0;
@ -380,17 +385,17 @@ class Content(QtGui.QWidget):
line-height: 1.6;
}
</style>
</head>
<body>
</head>
<body class='""" + _platform + """''>
<header>
<p><span id="feed_title"></span> <span id="author"></span></p>
<h1><a id="title" href=""></a></h1>
<p><timedate id="date"></timedate></p>
</header>
<article id="article"></article>
</body>
</html>
"""
</body>
</html>"""
return html # string.replace(html, "<body", "<body class='" + _platform + "'")

View file

@ -4,7 +4,7 @@ import os, PyQt4
from setuptools import setup
from sys import platform as _platform
VERSION = "0.1.0"
VERSION = "0.1.1"
APP = ["feedthemonkey"]
files = []