Skip to content

Commit

Permalink
Merge branch 'dev_thunderbird_60+' into install_out_of_extension_folder
Browse files Browse the repository at this point in the history
Conflicts:
	install.rdf
  • Loading branch information
ysard committed Dec 5, 2018
2 parents b086a53 + 20c4911 commit a0fbe77
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 26 deletions.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Bug report
about: Describe a bug in order to help us to fix it

---

**Describe the bug**
A clear and concise description of what the bug is.
Please check if your problem is related to the issue #7.
Do not forget that the console can provides additional information (Ctrl + Maj + J).

**To Reproduce**
Steps to reproduce the behavior:

**Expected behavior**
A clear and concise description of what you expected to happen.

**Desktop (please complete the following information):**
- OS: [e.g. Windows 7/8/10, Debian Jessie/Stretch, Ubuntu 16.04/Xenial, etc.]
- Thunderbird Version [e.g. 60.0, 60.2.1, 63, etc.]
4 changes: 2 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys

from build import build
import build

try:
xpi = sys.argv[1]
Expand All @@ -10,4 +10,4 @@
version = dom.getElementsByTagName("em:version")[0].firstChild.nodeValue
dom.unlink()
xpi = "mintrayr-{}.xpi".format(version)
sys.exit(build(".", xpi))
sys.exit(build.build(".", xpi))
4 changes: 3 additions & 1 deletion build/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
from build import build
from .build import build
from .context import StreamPositionRestore
from .context import ZipFileMinorCompression
20 changes: 10 additions & 10 deletions build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
try:
from path import Path as path
except ImportError:
print "Install path.py (pip install -r python_requirements.txt)"
print("Install path.py (pip install -r python_requirements.txt)")
sys.exit(1)

try:
from cmp_listed_locales import cmp_listed_locales
except ImportError, ex:
from .cmp_listed_locales import cmp_listed_locales
except ImportError as ex:
from warnings import warn
warn("cannot compare locales ({})".format(ex))
def cmp_listed_locales(dirname):
pass

from context import ZipFileMinorCompression
from .context import ZipFileMinorCompression

class ZipOutFile(ZipFile):
def __init__(self, zfile, method=None):
Expand Down Expand Up @@ -63,35 +63,35 @@ def build(basedir, outfile):
jar_files = (path(__file__).dirname() / "jar.files").lines(retain=False)
xpi_files = (path(__file__).dirname() / "xpi.files").lines(retain=False)

print "verifying locales"
print("verifying locales")
try:
cmp_listed_locales(basedir)
except:
print >> sys.stderr, "WARN: locales did not verify"

with ZipFileMinorCompression(), BytesIO() as xpi:
with ZipOutFile(xpi, method=ZIP_DEFLATED) as zp:
print "zipping regular files"
print("zipping regular files")
zip_files(zp, xpi_files, basedir)

print "creating inner jar"
print("creating inner jar")
with BytesIO() as jar:
with ZipOutFile(jar) as jp:
zip_files(jp, jar_files, basedir / "chrome/")
zp.writestr(ZipOutInfo("chrome.jar"), jar.read())

print "writing manifest"
print("writing manifest")
with open("chrome.manifest") as mf:
manifest = "\n".join((chromejar_line(l.strip())
for l in mf.readlines()
))
zp.writestr(ZipOutInfo("chrome.manifest"), manifest)

print "writing xpi"
print("writing xpi")
outputdir = basedir + "dist/"
if not os.path.exists(outputdir):
os.makedirs(outputdir)
with open(outputdir + outfile, "wb") as op:
op.write(xpi.read())
print "done!"
print("done!")
return 0
24 changes: 12 additions & 12 deletions build/cmp_listed_locales.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import re
import logging

from path import path
from path import Path as path
from Mozilla.CompareLocales import compareDirs

logging.basicConfig()
Expand Down Expand Up @@ -42,7 +42,7 @@ def parseCM():
if not baseloc:
raise ValueError("No base locale")

print "Using", baseloc, "as base locale"
print("Using", baseloc, "as base locale")

bad = list()
good = list()
Expand Down Expand Up @@ -75,8 +75,8 @@ def parseCM():
if not 'errors' in summary:
summary['errors'] = 0

print "Locale: %s" % l
print "Strings: %d (Missing: %d / %.2f%%)\nChanged: %d (%.2f%%), Unchanged %d (%.2f%%)\nErrors: %d" % (
print("Locale: %s" % l)
print( "Strings: %d (Missing: %d / %.2f%%)\nChanged: %d (%.2f%%), Unchanged %d (%.2f%%)\nErrors: %d" % (
summary['total'],
summary['missing'],
100.0 * summary['missing'] / (summary['total'] + summary['missing']),
Expand All @@ -85,18 +85,18 @@ def parseCM():
summary['unchanged'],
100.0 * summary['unchanged'] / summary['total'],
summary['errors']
)
))
branches = list(res.details.branches)
branches.sort()
print "Issues:"
print("Issues:")
for b in branches:
for f in b:
print "*", f
print("*", f)
for k, v in res.details[f].iteritems():
if isinstance(v, list):
v = ', '.join(v)
try:
print "\t%s: %s" % (unicode(k), unicode(v))
print("\t%s: %s" % (unicode(k), unicode(v)))
except:
pass
print
Expand All @@ -105,19 +105,19 @@ def parseCM():
continue
missing += l,
if bad:
print "Bad:", ' '.join(bad)
print("Bad:", ' '.join(bad))
if missing:
print "Missing:", ' '.join(missing)
print("Missing:", ' '.join(missing))
if good:
print 'Good:', ' '.join(good)
print('Good:', ' '.join(good))
if bad or missing:
raise ValueError("Not valid")

if __name__ == "__main__":
import sys
try:
cmp_listed_locales(path("."))
except Exception,ex:
except Exception as ex:
print >>sys.stderr, ex
sys.exit(1)
else:
Expand Down
10 changes: 10 additions & 0 deletions chrome/content/messenger/messenger.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ addEventListener(
// must be in sync with the original command
return window.minimize();
}
function MinTrayRKeyDown(event) {
// metakey => MacOS (command), Windows
if (event.metaKey) {
// Y key
if (event.which == 89) {
MinTrayRTryMinimizeWindow(event);
}
}
}

function hijackButton(newCommand, id) {
let button = $(id);
Expand All @@ -76,6 +85,7 @@ addEventListener(
['titlebar-close'].forEach(hijackButton.bind(null, MinTrayRTryCloseWindow));
['titlebar-min'].forEach(hijackButton.bind(null, MinTrayRTryMinimizeWindow));
window.addEventListener("close", MinTrayRTryCloseWindow);
window.addEventListener("keydown", MinTrayRKeyDown);
})(this);

this.cloneToMenu('MinTrayR_sep-top', [menu_NewPopup_id, "button-getAllNewMsg", "addressBook"], false);
Expand Down
2 changes: 1 addition & 1 deletion install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>mintray-reanimated@ysard</em:id>
<em:version>1.4.6dev</em:version>
<em:version>1.4.7dev</em:version>
<em:unpack>true</em:unpack>
<em:multiprocessCompatible>true</em:multiprocessCompatible>
<em:type>2</em:type>
Expand Down

0 comments on commit a0fbe77

Please sign in to comment.