Commit a61ad4e7 authored by Bobby Moss's avatar Bobby Moss

Added latest stable 0.1 release code

parents
To develop this you will need the following packages installed
python-pip
python2.7-dev
libxext-dev
python-qt4
qt4-dev-tools
build-essential
python-keyring
pyqt4-dev-tools
qt4-designer
Pip dependencies:
Mastodon.py
validators
html2text
(This document is temporary. Will clean this up later)
To run the application navigate to folder and run mastodome.py
Use pyuic4 if you want to convert ui files to python: pyuic4 file.ui -o file.py
This diff is collapsed.
This diff is collapsed.
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project owner at bob@bobstechsite.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project owner is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Mastodome - Desktop Client for Mastodon
Copyright (C) 2018 Bobby Moss bob[at]bobstechsite.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
class Config:
def __init__(self):
self.GUI_LANG = "en"
self.GUI_LANG_FILE_LOC_PREFIX = "/config/lang/"
self.GUI_ICON_FILE_LOC_PREFIX = "/config/icons/"
self.GUI_IMG_FILE_LOC_PREFIX = "/config/img/"
self.GUI_IMG_AVATAR_CACHE_PREFIX = "/config/.cache/"
self.GUI_TOOT_MAX_SIZE_CHARS = 280
self.APP_NAME = "Mastodome"
self.APP_VERSION = "0.1"
self.APP_WEBSITE = "http://mastodome.com"
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" width="48" height="48" id="svg0">
<defs id="defs">
<linearGradient id="G0">
<stop id="s1" style="stop-color:#e6cf00;stop-opacity:1" offset="0"/>
<stop id="s2" style="stop-color:#fde94a;stop-opacity:1" offset="1"/>
</linearGradient>
<linearGradient id="G1">
<stop id="s3" style="stop-color:#fcf9fb;stop-opacity:1" offset="0"/>
<stop id="s4" style="stop-color:#fcf9fb;stop-opacity:0" offset="1"/>
</linearGradient>
<linearGradient id="G2">
<stop id="s5" style="stop-color:#000000;stop-opacity:0.63" offset="0"/>
<stop id="s6" style="stop-color:#000000;stop-opacity:0" offset="1"/>
</linearGradient>
<linearGradient x1="14.660452" y1="7.0243196" x2="24.030643" y2="34.826122" id="G3" xlink:href="#G1" gradientUnits="userSpaceOnUse"/>
<radialGradient cx="24" cy="22" r="22" fx="24" fy="22" id="R0" xlink:href="#G0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1,-0.2,0.2,1,-3.8,6.8)"/>
<radialGradient cx="17.3125" cy="25.53125" r="9.6875" fx="17.3125" fy="25.53125" id="R1" xlink:href="#G2" gradientUnits="userSpaceOnUse" gradientTransform="matrix(2.4,0,0,0.67,-17.1,22.4)"/>
</defs>
<path d="M 47,39.5 C 47,43.08967 36.702552,46 24,46 C 11.297449,46 1,43.08967 1,39.5 C 1,35.91 11.297449,32 24,32 C 36.702552,32 47,35.909969 47,39.5 z" id="s" style="opacity:0.5;fill:url(#R1)"/>
<path d="M 37.310531,41.5 L 24.030644,34.826121 L 10.735101,41.471448 L 13.289408,27.369086 L 2.5511635,17.368344 L 17.409702,15.326301 L 24.068641,2.5 L 30.697416,15.340488 L 45.551111,17.414249 L 34.789382,27.392039 L 37.310531,41.5 z" id="star" style="fill:url(#R0);stroke:#c4a000"/>
<path d="M 17.731857,15.79089 L 24.06374,3.5868195 L 30.369452,15.794804 L 44.440148,17.761498 L 40.820395,21.121507 C 24.382895,17.434007 31.36502,28.341981 13.251748,30.364721 L 13.819799,27.184324 L 3.6604518,17.718688 C 3.6604518,17.718688 17.731857,15.79089 17.731857,15.79089 z" id="hl" style="opacity:0.8;fill:url(#G3);stroke:none"/>
<path d="M 35.973752,39.712833 L 24.028333,33.709386 L 12.082531,39.678326 L 14.362768,27.008543 L 4.7776396,18.070249 L 18.056076,16.247921 L 24.062792,4.6783526 L 30.045232,16.255741 L 43.322959,18.11306 L 33.713703,27.034785 L 35.973752,39.712833 z" id="ol" style="opacity:0.68999999;fill:none;stroke:#ffffff"/>
</svg>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="k" x1="40.57" xlink:href="#a" gradientUnits="userSpaceOnUse" x2="41.69" y1="36.4" y2="35.49"/>
<linearGradient id="a">
<stop offset="0"/>
<stop stop-opacity="0" offset="1"/>
</linearGradient>
<linearGradient id="l" x1="20.05" xlink:href="#a" gradientUnits="userSpaceOnUse" x2="21.91" y1="36.32" y2="37.07"/>
<radialGradient id="g" gradientUnits="userSpaceOnUse" cy="17.06" cx="29.34" r="7.22">
<stop stop-color="#f4d9b1" offset="0"/>
<stop stop-color="#df9725" offset="1"/>
</radialGradient>
<radialGradient id="i" xlink:href="#a" gradientUnits="userSpaceOnUse" cy="22.51" cx="30.99" r="8.662"/>
<linearGradient id="m" xlink:href="#c" gradientUnits="userSpaceOnUse" x2="0" y1="29.55" y2="35.8"/>
<linearGradient id="c">
<stop stop-color="#fff" offset="0"/>
<stop stop-color="#c9c9c9" offset="1"/>
</linearGradient>
<radialGradient id="h" gradientUnits="userSpaceOnUse" cy="27.2" cx="28.09" gradientTransform="matrix(1.298 0 0 .8848 -8.358 4.941)" r="13.56">
<stop stop-color="#3b74bc" offset="0"/>
<stop stop-color="#2d5990" offset="1"/>
</radialGradient>
<radialGradient id="f" xlink:href="#a" gradientUnits="userSpaceOnUse" cy="19.01" cx="31.11" gradientTransform="matrix(1.776 0 0 .584 -24.25 28.28)" r="8.662"/>
<linearGradient id="p" x1="27.27" xlink:href="#a" gradientUnits="userSpaceOnUse" x2="28.38" y1="29.22" y2="28.32"/>
<linearGradient id="o" x1="6.742" xlink:href="#a" gradientUnits="userSpaceOnUse" x2="8.602" y1="29.15" y2="29.9"/>
<linearGradient id="n" xlink:href="#c" gradientUnits="userSpaceOnUse" x2="0" y1="22.55" y2="28.8"/>
<radialGradient id="e" gradientUnits="userSpaceOnUse" cy="10.06" cx="16.22" r="7.22">
<stop stop-color="#e9b15e" offset="0"/>
<stop stop-color="#966416" offset="1"/>
</radialGradient>
<radialGradient id="d" xlink:href="#a" gradientUnits="userSpaceOnUse" cy="15.51" cx="17.86" r="8.662"/>
<radialGradient id="j" gradientUnits="userSpaceOnUse" cy="19.84" cx="16.22" gradientTransform="matrix(1 0 0 .6819 0 8.234)" r="13.56">
<stop stop-color="#727e0a" offset="0"/>
<stop stop-color="#5b6508" offset="1"/>
</radialGradient>
<radialGradient id="b" xlink:href="#a" gradientUnits="userSpaceOnUse" cy="19.01" cx="31.11" gradientTransform="matrix(1.776 0 0 .9592 -37.38 11.77)" r="8.662"/>
</defs>
<ellipse rx="15.38" ry="8.309" cy="30" cx="17.86" fill="url(#b)"/>
<path stroke-linejoin="round" d="m12.86 34.64h10.61c3.01 0 5.98-1.102 7.07-4.243 1.036-2.982 0.177-8.662-6.541-13.26h-12.55c-6.718 4.243-7.557 10.05-6.01 13.44 1.576 3.454 4.243 4.066 7.425 4.066z" stroke="#404604" stroke-linecap="round" fill="url(#j)"/>
<path fill="#9db029" d="m17.93 19.79s-2.151 1.66-1.966 3.66c-2.041-1.801-2.1-5.252-2.1-5.252l4.066 1.591"/>
<path opacity=".2150" stroke-linejoin="round" d="m12.97 33.57h10.32c2.64 0 5.253-0.968 6.211-3.727 0.91-2.62-0.095-7.609-5.995-11.65h-11.52c-5.916 3.74-6.903 8.83-5.544 11.81 1.384 3.034 3.727 3.571 6.522 3.571z" stroke="#fff" stroke-linecap="round" fill="none"/>
<path fill="#9db029" d="m18.91 19.79s2.151 1.66 1.966 3.66c2.041-1.801 2.1-5.252 2.1-5.252l-4.066 1.591"/>
<circle cy="15.51" cx="17.86" r="8.662" fill="url(#d)"/>
<circle stroke="#6f4709" cy="12" cx="17.99" r="8.662" fill="url(#e)"/>
<circle opacity=".1270" stroke="#fff" cy="12.01" cx="17.99" r="7.597" fill="none"/>
<path fill="url(#n)" d="m22.58 27.04h4.243l-2.475-2.298-0.53 0.707-0.53-0.53-0.707 2.121"/>
<path opacity=".2280" d="m8.548 33.6c-1.248-0.54-1.806-1.86-1.806-1.86 0.841-4.069 3.72-7.05 3.72-7.05s-2.279 6.412-1.914 8.904" fill="url(#o)"/>
<path opacity=".2280" d="m27.45 32.74c1.231-0.581 1.804-2 1.804-2-0.95-4.04-3.97-6.84-3.97-6.84s2.465 6.343 2.172 8.845" fill="url(#p)"/>
<ellipse rx="15.38" ry="5.059" cy="39.38" cx="30.99" fill="url(#f)"/>
<path stroke-linejoin="round" d="m25.99 41.64h10.61c3.01 0 5.98-1.102 7.07-4.243 1.036-2.983 0.177-8.662-6.541-13.26h-12.56c-6.718 4.243-7.557 10.04-6.01 13.44 1.576 3.454 4.243 4.066 7.425 4.066z" stroke="#204a87" stroke-linecap="round" fill="url(#h)"/>
<path fill="url(#m)" d="m26.69 25.73c3.182 2.828 4.596 13.08 4.596 13.08s1.414-10.25 3.889-13.26l-8.49 0.17"/>
<path fill="#729fcf" d="m28.97 26.79s-2.151 1.66-1.966 3.66c-2.041-1.801-2.1-5.252-2.1-5.252l4.066 1.591"/>
<path opacity=".2150" stroke-linejoin="round" d="m25.91 40.59 10.49-0.022c2.64 0 5.253-0.968 6.211-3.727 0.91-2.62-0.095-7.609-5.995-11.65l-11.52-0.23c-5.901 3.727-7.04 8.823-5.662 12.04 1.381 3.221 3.395 3.571 6.477 3.593z" stroke="#fff" stroke-linecap="round" fill="none"/>
<path fill="#729fcf" d="m33.41 26.79s2.151 1.66 1.966 3.66c2.041-1.801 2.1-5.252 2.1-5.252l-4.07 1.59"/>
<circle cy="22.51" cx="30.99" r="8.662" fill="url(#i)"/>
<circle stroke="#c17d11" cy="19.01" cx="31.11" r="8.662" fill="url(#g)"/>
<circle opacity=".1960" stroke="#fff" cy="19.01" cx="31.11" r="7.597" fill="none"/>
<path opacity=".2280" d="m21.85 40.78c-1.248-0.545-1.806-1.858-1.806-1.858 0.841-4.069 3.72-7.05 3.72-7.05s-2.279 6.411-1.914 8.904" fill="url(#l)"/>
<path opacity=".2280" d="m40.76 39.92c1.231-0.581 1.804-2 1.804-2-0.959-4.04-3.976-6.843-3.976-6.843s2.465 6.343 2.172 8.845" fill="url(#k)"/>
</svg>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="svg11300" height="48px" width="48px">
<defs id="defs3">
<linearGradient id="linearGradient3264">
<stop id="stop3266" offset="0" style="stop-color:#c9c9c9;stop-opacity:1;"/>
<stop style="stop-color:#f8f8f8;stop-opacity:1;" offset="0.25" id="stop3276"/>
<stop style="stop-color:#e2e2e2;stop-opacity:1;" offset="0.5" id="stop3272"/>
<stop id="stop3274" offset="0.75" style="stop-color:#b0b0b0;stop-opacity:1;"/>
<stop id="stop3268" offset="1" style="stop-color:#c9c9c9;stop-opacity:1;"/>
</linearGradient>
<linearGradient id="linearGradient3256">
<stop id="stop3258" offset="0" style="stop-color:#000000;stop-opacity:1;"/>
<stop id="stop3260" offset="1" style="stop-color:#000000;stop-opacity:0;"/>
</linearGradient>
<radialGradient gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.000000,0.000000,0.000000,0.315315,0.000000,26.81305)" r="19.622213" fy="39.161163" fx="25.455845" cy="39.161163" cx="25.455845" id="radialGradient3262" xlink:href="#linearGradient3256"/>
<linearGradient gradientTransform="matrix(1.241935,0.000000,0.000000,1.241935,-5.027508,-7.208988)" y2="39.684914" x2="34.534348" y1="12.284524" x1="14.462892" gradientUnits="userSpaceOnUse" id="linearGradient3281" xlink:href="#linearGradient3264"/>
</defs>
<g id="layer1">
<path transform="translate(-0.883885,2.474874)" d="M 45.078058 39.161163 A 19.622213 6.1871843 0 1 1 5.8336315,39.161163 A 19.622213 6.1871843 0 1 1 45.078058 39.161163 z" id="path3254" style="opacity:0.40909089;color:#000000;fill:url(#radialGradient3262);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"/>
<path id="path3243" d="M 23.25 0.46875 C 22.784561 0.50059628 22.332166 0.57268469 21.875 0.625 L 21.84375 0.625 L 20.75 6.59375 C 18.967275 6.9997399 17.290091 7.6887415 15.78125 8.625 L 10.875 5.09375 C 9.5487118 6.1234406 8.3418016 7.3243453 7.28125 8.625 L 10.6875 13.59375 C 9.6532671 15.174265 8.8755317 16.978974 8.4375 18.875 C 8.437425 18.883963 8.4374391 18.904688 8.4375 18.90625 L 2.5 19.84375 C 2.3914467 20.730383 2.34375 21.646689 2.34375 22.5625 C 2.3437501 23.3118 2.3644394 24.051089 2.4375 24.78125 L 8.375 25.84375 C 8.797279 27.905642 9.5994587 29.831262 10.71875 31.53125 L 7.1875 36.375 C 8.1988261 37.630518 9.3663917 38.773616 10.625 39.78125 L 15.625 36.34375 C 17.372433 37.458467 19.323083 38.240124 21.4375 38.625 L 22.375 44.53125 C 23.041183 44.591889 23.724349 44.59375 24.40625 44.59375 C 25.368935 44.593749 26.288487 44.557267 27.21875 44.4375 L 28.34375 38.40625 C 30.351311 37.906649 32.237219 37.03996 33.875 35.875 L 38.6875 39.375 C 39.935528 38.313203 41.076777 37.092744 42.0625 35.78125 L 38.5625 30.71875 C 39.510353 29.08176 40.167129 27.275609 40.5 25.34375 L 46.40625 24.40625 C 46.458044 23.789904 46.46875 23.192163 46.46875 22.5625 C 46.46875 21.468286 46.341568 20.395416 46.1875 19.34375 L 40.1875 18.25 C 39.717306 16.513776 38.945824 14.893898 37.96875 13.4375 L 41.5 8.59375 C 40.405427 7.2551429 39.156822 6.0185688 37.78125 4.96875 L 32.6875 8.46875 C 31.223504 7.6029126 29.648037 6.9385679 27.9375 6.5625 L 27 0.625 C 26.146701 0.52462461 25.286379 0.46875 24.40625 0.46875 C 24.168378 0.46875001 23.923566 0.4612654 23.6875 0.46875 C 23.572417 0.47239881 23.458534 0.4620551 23.34375 0.46875 C 23.312662 0.4705632 23.281029 0.46662691 23.25 0.46875 z M 24.0625 15.65625 C 24.176666 15.650457 24.290652 15.65625 24.40625 15.65625 C 28.105377 15.65625 31.125 18.675874 31.125 22.375 C 31.125001 26.074126 28.105376 29.0625 24.40625 29.0625 C 20.707125 29.062501 17.71875 26.074126 17.71875 22.375 C 17.718751 18.791473 20.52335 15.835842 24.0625 15.65625 z " style="opacity:1;color:#000000;fill:url(#linearGradient3281);fill-opacity:1;fill-rule:nonzero;stroke:#808080;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"/>
<path transform="matrix(0.606518,0.000000,0.000000,0.606518,10.15021,7.936835)" d="M 36.239223 23.781593 A 12.727922 12.727922 0 1 1 10.783379,23.781593 A 12.727922 12.727922 0 1 1 36.239223 23.781593 z" id="path3283" style="opacity:0.64772728;color:#000000;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:1.64875567;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"/>
<path style="opacity:0.34659089;color:#000000;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.9999997;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" d="M 22.557788,1.6501132 L 21.679599,7.4291233 C 20.008601,7.8096689 16.934874,8.9735344 15.520595,9.8511162 L 10.848562,6.3639293 C 9.6053938,7.3290873 9.5201391,7.3945394 8.5260544,8.6136804 L 11.904107,13.623634 C 10.934692,15.105095 9.7703031,17.745129 9.3522336,19.631722 C 9.3522336,19.631722 3.4328248,20.629563 3.4328248,20.629563 C 3.3310749,21.460629 3.3799751,23.239361 3.4484569,23.923761 L 9.1027005,24.942349 C 9.4985145,26.875018 10.979731,29.985937 12.028874,31.579383 L 8.4532981,36.303427 C 9.4012426,37.480259 9.5909623,37.587948 10.770691,38.532432 L 15.551859,35.029612 C 17.189777,36.074467 20.440892,37.345498 22.422794,37.706253 L 23.207481,43.412507 C 23.831913,43.469346 25.556962,43.628788 26.428924,43.516527 L 27.307112,37.576373 C 29.188855,37.108084 32.440272,35.773413 33.97541,34.681463 L 38.751465,38.132271 C 39.921276,37.13702 39.931757,36.987055 40.855703,35.757755 L 37.316505,30.727054 C 38.204954,29.192656 39.353733,26.191831 39.665742,24.381045 L 45.460384,23.419582 C 45.508931,22.841863 45.511294,21.230793 45.366882,20.245037 L 39.463105,19.226449 C 39.022378,17.599038 37.509894,14.666467 36.594056,13.301345 L 40.346408,8.5773019 C 39.320436,7.3225876 38.938964,7.150431 37.649602,6.1664065 L 32.707289,9.7056032 C 31.335043,8.8940304 28.598675,7.6568558 26.995341,7.3043568 L 26.122266,1.6501132 C 25.322445,1.5560285 23.014871,1.5978075 22.557788,1.6501132 z " id="path3285"/>
</g>
</svg>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Mastodome - Desktop Client for Mastodon
Copyright (C) 2018 Bobby Moss bob[at]bobstechsite.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from config import Config
import os
class Icons:
def __init__(self):
config = Config()
path = os.curdir + config.GUI_ICON_FILE_LOC_PREFIX
self.btnHomeIcon = path + "home.svg"
self.btnLocalIcon = path + "local.svg"
self.btnPublicIcon = path + "public.svg"
self.actionLoginLockedIcon = path + "login_locked.svg"
self.actionLoginUnlockedIcon = path + "login_unlocked.svg"
self.actionLogoutIcon = path + "logout.svg"
self.actionExiticon = path + "exit.svg"
self.actionPrefIcon = path + "pref.svg"
self.actionRefreshIcon = path + "refresh.svg"
self.actionLinkIcon = path + "link.svg"
self.actionSubscribeIcon = path + "sub.svg"
self.actionHelpIcon = path + "help.svg"
self.actionAboutIcon = path + "about.svg"
class Pics:
def __init__(self):
config = Config()
path = os.curdir + config.GUI_IMG_FILE_LOC_PREFIX
self.loginLogoImg = path + "mastodon_logo.svg"
self.loginMascotImg = path + "mastodon_mascot.png"
self.aboutMascoutImg = path + "mastodome_art.png"
self.appLogoImg = path + "mastodome_logo.svg"
This diff is collapsed.
<svg xmlns="http://www.w3.org/2000/svg" width="61.076954mm" height="65.47831mm" viewBox="0 0 216.4144 232.00976">
<path fill="#2b90d9" d="M211.80734 139.0875c-3.18125 16.36625-28.4925 34.2775-57.5625 37.74875-15.15875 1.80875-30.08375 3.47125-45.99875 2.74125-26.0275-1.1925-46.565-6.2125-46.565-6.2125 0 2.53375.15625 4.94625.46875 7.2025 3.38375 25.68625 25.47 27.225 46.39125 27.9425 21.11625.7225 39.91875-5.20625 39.91875-5.20625l.8675 19.09s-14.77 7.93125-41.08125 9.39c-14.50875.7975-32.52375-.365-53.50625-5.91875C9.23234 213.82 1.40609 165.31125.20859 116.09125c-.365-14.61375-.14-28.39375-.14-39.91875 0-50.33 32.97625-65.0825 32.97625-65.0825C49.67234 3.45375 78.20359.2425 107.86484 0h.72875c29.66125.2425 58.21125 3.45375 74.8375 11.09 0 0 32.975 14.7525 32.975 65.0825 0 0 .41375 37.13375-4.59875 62.915"/>
<path fill="#fff" d="M177.50984 80.077v60.94125h-24.14375v-59.15c0-12.46875-5.24625-18.7975-15.74-18.7975-11.6025 0-17.4175 7.5075-17.4175 22.3525v32.37625H96.20734V85.42325c0-14.845-5.81625-22.3525-17.41875-22.3525-10.49375 0-15.74 6.32875-15.74 18.7975v59.15H38.90484V80.077c0-12.455 3.17125-22.3525 9.54125-29.675 6.56875-7.3225 15.17125-11.07625 25.85-11.07625 12.355 0 21.71125 4.74875 27.8975 14.2475l6.01375 10.08125 6.015-10.08125c6.185-9.49875 15.54125-14.2475 27.8975-14.2475 10.6775 0 19.28 3.75375 25.85 11.07625 6.36875 7.3225 9.54 17.22 9.54 29.675"/>
</svg>
This diff is collapsed.
{
"MainWindow": "",
"btnHomeStreamShortcut": "Ctrl+H",
"btnHomeStreamTooltip": "View your home toot stream",
"btnLocalStreamShortcut": "Ctrl+L",
"btnLocalStreamTooltip": "View the local server toot stream",
"btnPublicStreamShortcut": "Ctrl+P",
"btnPublicStreamTooltip": "View the public toot stream",
"btnToot": "Toot!",
"btnTootLoad": "Tooting...",
"btnTootTooltip": "Send a new toot",
"lblStatus": "Logged out",
"lblStatusAction": "Logging in...",
"lblStatusComplete": "Logged in",
"menuFile": "File",
"menuEdit": "Edit",
"menuHelp": "Help",
"menuInsert": "Insert",
"menuRSS": "RSS",
"actionLogin": "Login...",
"actionLoginShortcut": "Ctrl+N",
"actionLoginTooltip": "Login to Mastodon",
"actionLogout": "Logout...",
"actionLogoutShortcut": "Ctrl+L",
"actionLogoutTooltip": "Logout of Mastodon",
"actionExit": "Exit",
"actionExitShortcut": "Ctrl+Q",
"actionExitTooltip": "Exit",
"actionRefresh": "Refresh",
"actionRefreshShortcut": "F5",
"actionRefreshTooltip": "Refresh the visible toot stream and user notifications",
"actionPreferences": "Preferences",
"actionPreferencesTooltip": "Configure the application",
"actionOnline_Help": "Online Help...",
"actionOnline_HelpShortcut": "F1",
"actionOnline_HelpTooltip": "Show help contents",
"actionAbout": "About",
"actionAboutTooltip": "Show information about",
"actionLink": "Link Account...",
"actionLinkTooltip": "Link to a third party service",
"actionSubscribe_to": "Subscribe to...",
"actionSubscribe_toTooltip": "Subscribe to an RSS feed",
"loginDialog": "Login to Mastodon",
"mServerLabel": "Server URL:",
"unameLabel": "Email address:",
"pwdLabel": "Password:",
"DialogAbout": "About",
"lblAppDesc": "is a native desktop client for Mastodon. Runs best on GNU/Linux.",
"lblCopyright": "Copyright © 2018 Bobby Moss<br/>Freely licensed under the GNU GPLv3 or later.",
"notify_mention": "mentioned you in",
"notify_reblog": "boosted you in",
"notify_fav": "favourited you in",
"notify_follow": "followed you",
"stream_toot_fetched": "sent a toot",
"stream_reply_fetched": "replied with",
"stream_boost_fetched": "Boosted by"
}
\ No newline at end of file
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Mastodome - Desktop Client for Mastodon
Copyright (C) 2018 Bobby Moss bob[at]bobstechsite.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import json
from config import Config
import os
class Translations:
def __init__(self):
config = Config()
self.translations = json.load(open(os.curdir + config.GUI_LANG_FILE_LOC_PREFIX + config.GUI_LANG + '.json'))
def load(self, control_name):
return self.translations[control_name]
name,role,email,website,mastodon
Bobby Moss,Creator and Project Manager,bob[at]bobstechsite.com,https://bobstechsite.com,@bobstechsite@mastodon.technology
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Mastodome - Desktop Client for Mastodon
Copyright (C) 2018 Bobby Moss bob[at]bobstechsite.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from PyQt4 import QtCore, QtGui
from config.translations import Translations
from config.icons_pics import Icons, Pics
from config import config
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class ui_dialog_about(object):
def setupUi(self, DialogAbout):
DialogAbout.setObjectName(_fromUtf8("DialogAbout"))
DialogAbout.resize(400, 446)
icons = Icons()
DialogAbout.setWindowIcon(QtGui.QIcon(icons.actionAboutIcon))
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(DialogAbout.sizePolicy().hasHeightForWidth())
DialogAbout.setSizePolicy(sizePolicy)
DialogAbout.setMinimumSize(QtCore.QSize(400, 446))
DialogAbout.setMaximumSize(QtCore.QSize(400, 446))
self.lblLogo = QtGui.QLabel(DialogAbout)
self.lblLogo.setGeometry(QtCore.QRect(140, 70, 121, 20))
self.lblLogo.setObjectName(_fromUtf8("lblLogo"))
self.lblAppVersion = QtGui.QLabel(DialogAbout)
self.lblAppVersion.setGeometry(QtCore.QRect(10, 160, 381, 41))
font = QtGui.QFont()
font.setPointSize(24)
font.setBold(True)
font.setWeight(75)
self.lblAppVersion.setFont(font)
self.lblAppVersion.setTextFormat(QtCore.Qt.RichText)
self.lblAppVersion.setScaledContents(False)
self.lblAppVersion.setAlignment(QtCore.Qt.AlignCenter)
self.lblAppVersion.setObjectName(_fromUtf8("lblAppVersion"))
self.lblAppDesc = QtGui.QLabel(DialogAbout)
self.lblAppDesc.setGeometry(QtCore.QRect(10, 210, 381, 51))
self.lblAppDesc.setAlignment(QtCore.Qt.AlignCenter)
self.lblAppDesc.setWordWrap(True)
self.lblAppDesc.setObjectName(_fromUtf8("lblAppDesc"))
self.lblCopyright = QtGui.QLabel(DialogAbout)
self.lblCopyright.setGeometry(QtCore.QRect(10, 270, 381, 51))
font = QtGui.QFont()
font.setPointSize(9)
self.lblCopyright.setFont(font)
self.lblCopyright.setAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop)
self.lblCopyright.setWordWrap(True)
self.lblCopyright.setObjectName(_fromUtf8("lblCopyright"))
self.retranslate_ui(DialogAbout)
QtCore.QMetaObject.connectSlotsByName(DialogAbout)
def retranslate_ui(self, DialogAbout):
lingo = Translations()
pics = Pics()
this_config = config.Config()
DialogAbout.setWindowTitle(_translate("DialogAbout", lingo.load("DialogAbout")
+ " "
+ this_config.APP_NAME, None))
self.lblAppVersion.setText(_translate("DialogAbout", this_config.APP_NAME
+ " "
+ this_config.APP_VERSION, None))
self.lblAppDesc.setText(_translate("DialogAbout", this_config.APP_NAME + " " + lingo.load("lblAppDesc"), None))
self.lblCopyright.setText(_translate("DialogAbout", "<html><head/><body><p align=\"center\">"
+ lingo.load("lblCopyright")
+ "<br/><a href=\""
+ this_config.APP_WEBSITE
+ "\"><span style=\" text-decoration: underline; color:#0000ff;\">"
+ this_config.APP_WEBSITE
+ "</span></a></p></body></html>", None))
self.lblLogo.resize(250, 250)
mastodome_mascot = QtGui.QPixmap(pics.aboutMascoutImg).scaled(self.lblLogo.size())
self.lblLogo.setPixmap(mastodome_mascot)
self.lblLogo.move(75, 20)
self.lblAppVersion.move(10, 280)
self.lblAppDesc.move(10, 310)
self.lblCopyright.move(10, 360)
\ No newline at end of file
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Mastodome - Desktop Client for Mastodon
Copyright (C) 2018 Bobby Moss bob[at]bobstechsite.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from PyQt4 import QtCore, QtGui
from config.translations import Translations
from config.icons_pics import Pics
from rest.credentials import Credentials
from rest import api
import validators
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class ui_login_dialog(object):
def setupUi(self, loginDialog):
loginDialog.setObjectName(_fromUtf8("loginDialog"))
loginDialog.resize(400, 300)
loginDialog.setMinimumSize(QtCore.QSize(400, 300))
loginDialog.setMaximumSize(QtCore.QSize(400, 300))
pics = Pics()
loginDialog.setWindowIcon(QtGui.QIcon(pics.loginLogoImg))
self.new_session = None
self.buttonBox = QtGui.QDialogButtonBox(loginDialog)
self.buttonBox.setGeometry(QtCore.QRect(30, 240, 341, 32))
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.formLayoutWidget = QtGui.QWidget(loginDialog)
self.formLayoutWidget.setGeometry(QtCore.QRect(30, 120, 341, 101))
self.formLayoutWidget.setObjectName(_fromUtf8("formLayoutWidget"))
self.formLayout = QtGui.QFormLayout(self.formLayoutWidget)
self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
self.formLayout.setObjectName(_fromUtf8("formLayout"))
self.mServerLabel = QtGui.QLabel(self.formLayoutWidget)
self.mServerLabel.setObjectName(_fromUtf8("mServerLabel"))
self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.mServerLabel)
self.mServerLineEdit = QtGui.QLineEdit(self.formLayoutWidget)
self.mServerLineEdit.setInputMethodHints(QtCore.Qt.ImhUrlCharactersOnly)
self.mServerLineEdit.setObjectName(_fromUtf8("mServerLineEdit"))
self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.mServerLineEdit)
self.unameLabel = QtGui.QLabel(self.formLayoutWidget)
self.unameLabel.setObjectName(_fromUtf8("unameLabel"))
self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.unameLabel)
self.uNameLineEdit = QtGui.QLineEdit(self.formLayoutWidget)
self.uNameLineEdit.setObjectName(_fromUtf8("uNameLineEdit"))
self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.uNameLineEdit)
self.pwdLabel = QtGui.QLabel(self.formLayoutWidget)
self.pwdLabel.setObjectName(_fromUtf8("pwdLabel"))
self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.pwdLabel)
self.pwdLineEdit = QtGui.QLineEdit(self.formLayoutWidget)
self.pwdLineEdit.setInputMethodHints(QtCore.Qt.ImhHiddenText|QtCore.Qt.ImhNoAutoUppercase|QtCore.Qt.ImhNoPredictiveText)
self.pwdLineEdit.setEchoMode(QtGui.QLineEdit.Password)
self.pwdLineEdit.setObjectName(_fromUtf8("pwdLineEdit"))
self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.pwdLineEdit)
self.lblMastoLogo = QtGui.QLabel(loginDialog)
self.lblMastoLogo.setGeometry(QtCore.QRect(140, 50, 120, 20))
self.lblMastoLogo.setObjectName(_fromUtf8("lblMastoLogo"))
self.retranslate_ui(loginDialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), loginDialog.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), loginDialog.reject)
QtCore.QMetaObject.connectSlotsByName(loginDialog)
loginDialog.accepted.connect(self.complete_login)
def retranslate_ui(self, loginDialog):
lingo = Translations()
pics = Pics()
loginDialog.setWindowTitle(_translate("loginDialog", lingo.load("loginDialog"), None))
self.mServerLabel.setText(_translate("loginDialog", lingo.load("mServerLabel"), None))
self.unameLabel.setText(_translate("loginDialog", lingo.load("unameLabel"), None))
self.pwdLabel.setText(_translate("loginDialog", lingo.load("pwdLabel"), None))
self.lblMastoLogo.resize(120, 120)
mastodon_mascot = QtGui.QPixmap(pics.loginMascotImg).scaled(self.lblMastoLogo.size())
self.lblMastoLogo.setPixmap(mastodon_mascot)
self.lblMastoLogo.move(140, 5)
self.mServerLineEdit.setText("https://")
self.mServerLineEdit.setFocus(True)
def complete_login(self):
server_url = str(self.mServerLineEdit.text())
user_name = str(self.uNameLineEdit.text())
if not validators.url(server_url):
print('Not a valid server URL')
raise ValueError
if not validators.email(user_name):
print('Not a valid user name')
raise ValueError
login_attempt = Credentials(server_url)
try:
if not login_attempt.is_client_registered():
login_attempt.client_register()
except Exception as inst:
print type(inst)
raise
user_pwd = str(self.pwdLineEdit.text())
try:
if not login_attempt.is_user_registered():
login_attempt.user_register(user_name, user_pwd)
except Exception as inst:
print type(inst)
raise
try:
new_session = api.Session(server_url)
new_session.initialise_session(user_name, user_pwd)