Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test pull request #137

Open
wants to merge 74 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
251de18
Add Workflow
sDriskell Mar 31, 2020
b3e7595
Testing branch/push functionality for project
Mar 31, 2020
5300ff3
Change Workflow
sDriskell Mar 31, 2020
be6d6b1
Remove Previous Workflow
sDriskell Mar 31, 2020
f80d2f4
Merge remote-tracking branch 'origin/master' into ShaneTestBranch
Mar 31, 2020
bfde1bc
Remove pythonapp.yml
Mar 31, 2020
54ca56f
Merge remote-tracking branch 'origin/master' into ShaneTestBranch
Mar 31, 2020
f3057a9
Merge branch 'ShaneTestBranch'
Mar 31, 2020
4ecd40e
Use App Workflow
sDriskell Mar 31, 2020
079dddd
Delete pythonpackage.yml
sDriskell Mar 31, 2020
5ad356b
Merge branch 'master' of https://github.com/sDriskell/QTodoTxt2 into …
Mar 31, 2020
9703b2e
testing commit/push functionality of Pycharm with project
Mar 31, 2020
2e3e0aa
Merge pull request #2 from sDriskell/ShaneTestBranch
sDriskell Mar 31, 2020
7ba71c9
Commit and push with requirements.txt
Mar 31, 2020
df563e9
Add files via upload
sDriskell Mar 31, 2020
e658890
Merge branch 'master' of https://github.com/sDriskell/QTodoTxt2
Mar 31, 2020
a89894b
Commit and push with requirements.txt
Mar 31, 2020
ab0e027
Commit and push with requirements.txt
Mar 31, 2020
08ead2a
My initial commit. Fixed font size issue.
Mark-Pasq Apr 10, 2020
7593187
Merge pull request #4 from Mark-Pasq/MarksBranch
Mark-Pasq Apr 10, 2020
c389b7a
Revert "My initial commit. Fixed font size issue."
Mark-Pasq Apr 10, 2020
90f06bc
Merge pull request #5 from sDriskell/revert-4-MarksBranch
Mark-Pasq Apr 10, 2020
0feace8
cleaned up commented out code, seemed unused
bclodge Apr 10, 2020
a8be974
Merge pull request #6 from sDriskell/BrandonBranch
sDriskell Apr 10, 2020
56034b5
Removed commented out code to test merging.
Apr 10, 2020
cb38d87
Mark's Branch here.
Apr 13, 2020
13a983e
Cleaning out commented code and fixing flake-8 issues
Apr 13, 2020
096697a
Merge remote-tracking branch 'origin/master'
Apr 13, 2020
ff52907
Testing Workflow for application
Apr 13, 2020
34a2797
Merge remote-tracking branch 'origin/master' into shaneBranch2
Apr 13, 2020
a278f50
Update app.py
sDriskell Apr 13, 2020
a37ae1d
Update pythonapp.yml
sDriskell Apr 13, 2020
1b0bdd2
Testing Workflow for application
Apr 13, 2020
b89bf8e
Merge pull request #7 from sDriskell/ShaneBranch3
sDriskell Apr 13, 2020
dd76f69
Testing Workflow for application
Apr 13, 2020
6e79729
Merge pull request #8 from sDriskell/ShaneBranch3
sDriskell Apr 13, 2020
1e71ff4
Update pythonapp.yml
sDriskell Apr 13, 2020
598e45e
Update pythonapp.yml
sDriskell Apr 13, 2020
909ca74
Update pythonapp.yml
sDriskell Apr 13, 2020
a292a2b
Updated changes to Preferences.qml
Apr 13, 2020
cadbb38
Updated changes to tasklib.py and qtodotxt.pyw
Apr 13, 2020
ddb0865
Cleaning up errors to pass flake8.
Apr 14, 2020
817faf9
Cleaning up errors to pass flake8.
Apr 14, 2020
2b97453
Cleaning up errors to pass flake8.
Apr 14, 2020
1146e5c
Cleaning up errors to pass flake8 and creating separate branch from m…
Apr 14, 2020
6a8b6ca
Cleaning up errors to pass flake8 and creating separate branch from m…
Apr 14, 2020
dba4f9e
Updated changes to TaskLine.qml
Apr 14, 2020
49cdf8b
Cleaning out old commented code for better legibility.
Apr 14, 2020
edd5239
Minor changes to syntax of FilterView.qml and Preferences.qml
Apr 15, 2020
c01e494
Restoring a change to Preferences.qml
Apr 15, 2020
babc0e4
Merge remote-tracking branch 'origin/MarkBranch3' into HEAD
Apr 15, 2020
d248490
Updated FilterView.qml
Apr 15, 2020
a91cd63
TYPO-error fixed in TaskListTableView.qml
Apr 15, 2020
4530d41
Addition made to Preferences.qml
Apr 17, 2020
7f0a87f
Merge branch 'shaneBranch' into MarkBranch3
sDriskell Apr 26, 2020
7dd6cba
Merge pull request #9 from sDriskell/MarkBranch3
sDriskell Apr 26, 2020
b7a1479
Merge pull request #10 from sDriskell/shaneBranch
sDriskell Apr 26, 2020
f88ac0e
Demoing branches
bclodge Apr 26, 2020
b2d06f3
Merge branch 'shaneBranch' of https://github.com/sDriskell/QTodoTxt2 …
bclodge Apr 26, 2020
3e5df5c
Fixed error message in app for not excepting the date.
Apr 26, 2020
58e2370
Fixed error with Due: 's, which caused an error to generate in the app.
bclodge Apr 26, 2020
dd66eaf
Merge pull request #11 from sDriskell/BrandonBranch
sDriskell Apr 26, 2020
c82ecfc
Update to qtodotxt2
Apr 27, 2020
8173dfe
Fixed due date format to remove error message from within app; all te…
May 3, 2020
b3b9cfc
Reverting test functions to work with new date bug fix
May 3, 2020
a8ddd90
Continuing to update test functions to work with due bug fix
May 3, 2020
307eaf4
Flake 8 corrections
May 3, 2020
b9be11a
Flake 8 corrections
May 3, 2020
dff13e2
Fixed two test functions
May 4, 2020
0598017
Fixed flake8 error
May 4, 2020
2b6a270
Finish correcting testing errors.
May 5, 2020
2554cc9
Merge branch 'master' into MarkBranch
sDriskell May 5, 2020
5dcc60d
Merge pull request #12 from sDriskell/MarkBranch
sDriskell May 5, 2020
18b2095
Removed font sizing.
May 14, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python application

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --ignore=E225,E226,E231,E265,E302,E722,F401,F403,F405,C901 --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pip install pytest
pytest
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/QTodoTxt2.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/dictionaries/Dad.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions bin/qtodotxt.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import os
import sys

try:
__file__
__file__
except NameError:
__file__ = sys.argv[0]
__file__ = sys.argv[0]


def reroute_py2exe_logs():
appdata = os.path.expandvars("%AppData%\\QTodoTxt")
Expand All @@ -16,16 +17,15 @@ def reroute_py2exe_logs():
sys.stdout = open(appdata + "\\stdout.log", "w")
sys.stderr = open(appdata + "\\stderr.log", "w")


if sys.argv[0].lower().endswith('.exe'):
# If something goes wrong, logging information might help.
# Uncommenting line below allows logging to be stored at same location where exe resides
# If something goes wrong, logging information might help.
# Uncommenting line below allows logging to be stored at same location where exe resides
reroute_py2exe_logs()
sys.path.insert(0, os.path.join(os.path.dirname(__file__)))


sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))

from qtodotxt2 import app

app.run()

19 changes: 6 additions & 13 deletions examples/todo.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
(A) Make peace between Cylons and humans +PeaceProject
(A) Review NCMR Log +Admin @work t:2017-12-22 rec:+1b due:2017-12-22
(B) Report to <i>Admiral Adama</i> about FTL @CIC +GalacticaRepairs due:2013-05-24
(C) 2016-12-08 Feed Schrodinger's Cat rec:+1d due:2014-02-23
(C) Upgrade jump drives with Cylon technology +GalacticaRepairs
2016-12-12 +GalacticaRepairs Check hull integrity rec:+7b due:2016-12-12
Check for <b>DRADIS</b> contact @CIC
Check if http://google.com is available
Download code from <br/> https://github.com/QTodoTxt/QTodoTxt/archive/master.zip <br/>and give it a try!
Find the question due:2017-06-10 rec:6d t:2017-06-09
Think about <u>future</u> t:2099-12-31
h:1 @CIC +GalacticaRepairs @work
x 2016-02-21 (B) Seal ship's cracks with biomatter +GalacticaRepairs
2020-05-05
2020-05-05 (A) A thing @work @school +project due:2020-05-05
2020-05-05 (B) due thing due:2020-05-05
2020-05-05 (C) test text @test +project due:2020-05-16
2020-05-05 more things due:2020-05-01
x 2020-05-05 2020-05-05 finished due:2020-05-06
12 changes: 6 additions & 6 deletions packaging/Debian/buildDebPackage.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import urllib.request
import os
import os.path
import os.path
import sys
import tarfile
from shutil import copytree,ignore_patterns,copy,rmtree
from shutil import copytree, ignore_patterns, copy, rmtree
from stat import *
import fnmatch
import re
Expand Down Expand Up @@ -59,7 +59,7 @@ def buildPackageFolder(folderName):

#Fix execution rights on bin folder
for file in os.listdir(buildBinDir):
filePath=os.path.join(buildBinDir,file)
filePath=os.path.join(buildBinDir, file)
if os.path.isfile(filePath):
st = os.stat(filePath)
os.chmod(filePath, st.st_mode | S_IEXEC)
Expand All @@ -85,7 +85,7 @@ def makeMd5sums(baseDir,outputFilePath):

outputFile = open(outputFilePath, 'w')

for (root,dirs,files) in os.walk(baseDir):
for (root, dirs, files) in os.walk(baseDir):
dirs[:] = [d for d in dirs if not re.match(excludes,d)]
files = [f for f in files if not re.match(excludes,f)]

Expand All @@ -94,11 +94,10 @@ def makeMd5sums(baseDir,outputFilePath):
md5 = hashlib.md5(open(path,'rb').read()).hexdigest()
relativePath = root.replace(baseDir+'/',"",1) + os.sep + fn
outputFile.write("%s %s\n" % (md5,relativePath))

outputFile.close()


def generateControl(templateFile,packageVersion,outputFilePath):

templateExp = open(templateFile,'r').read()
template = Template(templateExp)

Expand Down Expand Up @@ -128,6 +127,7 @@ def clean(fileName,folderName):

# Call this with the version as first argument


version=sys.argv[1]
scriptDir = os.path.dirname(os.path.realpath(sys.argv[0]))
# Step 1: download tag from github
Expand Down
3 changes: 2 additions & 1 deletion packaging/MacOS/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def collect_packages(path, package_name, packages, excludes=None):
packages.append(subpackage_name)
collect_packages(subpath, subpackage_name, packages)


packages = []
collect_packages('.', '', packages, excludes=['test'])

Expand All @@ -58,4 +59,4 @@ def collect_packages(path, package_name, packages, excludes=None):
"build_base": os.path.join(current_dir, 'build')
},
}
)
)
9 changes: 6 additions & 3 deletions qtodotxt2/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def setupAnotherInstanceEvent(controller):
dirname = os.path.dirname(sys.argv[0])
fileObserver = FileObserver()
fileObserver.addPath(dirname)
#FIXME maybe do something in qml
#fileObserver.dirChangetSig.connect(controller.anotherInstanceEvent)
# FIXME maybe do something in qml
# fileObserver.dirChangetSig.connect(controller.anotherInstanceEvent)


def setupSingleton(args):
Expand All @@ -79,7 +79,7 @@ def run():
# Now set up our application and start
app = QtWidgets.QApplication(sys.argv)
# it is said, that this is lighter:
# (without qwidgets, as we probably don't need them anymore, when transition to qml is done)
# (without QWidgets, as we probably don't need them anymore, when transition to qml is done)
# app = QtGui.QGuiApplication(sys.argv)

name = QtCore.QLocale.system().name()
Expand All @@ -105,6 +105,9 @@ def run():

controller.start()
app.setWindowIcon(QtGui.QIcon(":/qtodotxt"))
# This line added to change the font and size if the default is too small.
# Working on a fontDialog so it can be changed that way. 2020-04-08

app.exec_()
sys.exit()

Expand Down
7 changes: 0 additions & 7 deletions qtodotxt2/filters_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ def __init__(self, parent, strings, flt=None, icon=None, order=None):
self.setData(flt, QtCore.Qt.UserRole)
self.filter = flt
parent.appendRow([self])
#if order:
#self.setText(1, str(order))
self.iconSource = icon

def setCounts(self, total, completed):
Expand Down Expand Up @@ -101,9 +99,6 @@ def addDueRangeFilter(self, flt, counts, sortKey=0):
item = FilterItem(parentItem, flt.text, flt=flt, icon=icon, order=sortKey)
item.setCounts(*counts)

#parentItem.setExpanded(True)
#parentItem.sortChildren(1, QtCore.Qt.AscendingOrder)

@QtCore.pyqtSlot(result='QVariantList')
def getRootChildren(self):
indexes = []
Expand Down Expand Up @@ -226,5 +221,3 @@ def filterTasks(filters, tasks):
filteredTasks.append(task)
break
return filteredTasks


12 changes: 3 additions & 9 deletions qtodotxt2/lib/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

from PyQt5 import QtCore

from qtodotxt2.lib.filters import DueTodayFilter, DueTomorrowFilter, DueThisWeekFilter, DueThisMonthFilter, DueOverdueFilter
from qtodotxt2.lib.filters import DueTodayFilter, DueTomorrowFilter, DueThisWeekFilter, DueThisMonthFilter, \
DueOverdueFilter
from qtodotxt2.lib.tasklib import Task

logger = logging.getLogger(__name__)


class File(QtCore.QObject):

fileExternallyModified = QtCore.pyqtSignal()
fileModified = QtCore.pyqtSignal(bool)

Expand Down Expand Up @@ -47,8 +47,6 @@ def _createTasksFromLines(self, lines):

def _taskModified(self, task):
self.setModified(True)
#if task not in self.tasks:
#self.tasks.append(task)
if not task.text:
self.deleteTask(task)

Expand All @@ -69,13 +67,12 @@ def connectTask(self, task):
task.modified.connect(self._taskModified)

def save(self, filename=''):
# logger.debug('File.save called with filename="%s"', filename)
self._fileObserver.clear()
if not filename and not self.filename:
self.filename = self._createNewFilename()
elif filename:
self.filename = filename
self.tasks = sorted(self.tasks) # we sort for users using simple text editors
self.tasks = sorted(self.tasks)
self._saveTasks()
self.modified = False
self.fileModified.emit(False)
Expand All @@ -95,7 +92,6 @@ def _createNewFilename():
def _saveTasks(self):
with open(self.filename, 'wt', encoding='utf-8') as fd:
fd.writelines([(task.text + self.newline) for task in self.tasks])
# logger.debug('%s was saved to disk.', self.filename)

def saveDoneTask(self, task):
doneFilename = os.path.join(os.path.dirname(self.filename), 'done.txt')
Expand Down Expand Up @@ -163,7 +159,6 @@ def getTasksCounters(self):


class FileObserver(QtCore.QFileSystemWatcher):

fileChangetSig = QtCore.pyqtSignal(str)
dirChangetSig = QtCore.pyqtSignal(str)

Expand All @@ -184,5 +179,4 @@ def dirChangedHandler(self, path):

def clear(self):
if self.files():
# logger.debug('Clearing watchlist.')
self.removePaths(self.files())
4 changes: 2 additions & 2 deletions qtodotxt2/lib/task_htmlizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def task2html(self, task):
# add space, so tasks get evenly aligned when there's no priority
html = '<tt>&nbsp;&nbsp;&nbsp;</tt>&nbsp;' + html
if task.completion_date:
html += ' <font color="{1!s}">(completed: {0!s})</font>'.format(task.completion_date, self.complColor)
html += ' <font color="{1!s}">(completed:{0!s})</font>'.format(task.completion_date, self.complColor)
if task.creation_date:
html += ' <font color="{1!s}">(created: {0!s})</font>'.format(task.creation_date, self.complColor)
html += ' <font color="{1!s}">(created:{0!s})</font>'.format(task.creation_date, self.complColor)
return html

def _addUrl(self, word, color="none"):
Expand Down
Loading