Compare commits

...

41 commits

Author SHA1 Message Date
Paul Beckingham
ba28fd0e04
Merge pull request #65 from tom-doerr/patch-1
Add Installation Instructions for Debian/Ubuntu
2020-11-21 09:38:52 -05:00
Paul Beckingham
06687e526b
Merge pull request #62 from 0xACE/submodulelibshared
updated url for libshared submodule
2020-11-21 09:38:17 -05:00
Tom Dörr
27bdb5019d Add Installation Instructions for Debian/Ubuntu
I spent quite some time trying to compile taskshell from source since I could not find `taskshell` with apt. Adding Installation Instructions might save other people time.
2020-02-09 23:08:16 +01:00
0xACE
abf75754f9 updated url for libshared submodule 2019-10-12 01:26:54 +02:00
Paul Beckingham
61dd5ea775
Merge pull request #46 from dbwest/patch-1
important info so people can build the project
2018-09-08 11:54:07 -04:00
David West
297b1b53c5
important info so people can build the project
not obvious to use recursive without a tip
2018-09-08 11:45:44 -04:00
Paul Beckingham
68d8a9acac Revert "Hide information by default in review"
This reverts commit 6bc537b9d9.
2018-06-02 19:57:55 -04:00
Paul Beckingham
41a4ed5f22
Merge pull request #39 from kmarekspartz/hide-information-in-review
Hide information by default in review
2018-06-02 19:55:02 -04:00
Kyle Marek-Spartz
6bc537b9d9 Hide information by default in review
Originally submitted to taskwarrior-dev: https://groups.google.com/forum/#!topic/taskwarrior-dev/a8XizQmscl8
2018-06-02 14:13:24 -07:00
Federico Hernandez
68864e8526 Added SHA1 of tagged release commit 2017-05-10 00:26:28 +02:00
Federico Hernandez
3f4b2284ad Version number and release date for 1.2.0 2017-05-10 00:05:29 +02:00
Paul Beckingham
e6d05328cf Docs: Updated platform list 2017-04-09 16:47:33 -04:00
Paul Beckingham
d2e7b4f31d libshared: Updated URL 2017-04-01 22:48:02 -04:00
Paul Beckingham
62de6475b0 libshared: Updated to f1a3cd6bfabfb083fe3c26f580a15c0d60a92ee9 2017-04-01 14:44:10 -04:00
Paul Beckingham
8c3580f5c6 TS-32: control-d to exit
- Thanks to Paul Fenwick.
2017-02-20 23:17:40 -05:00
Paul Fenwick
87d05ed28a TS-32: Exit on Ctrl-D on non-readline systems. 2017-02-20 23:15:20 -05:00
Paul Beckingham
d5bd17cff0 Review: report now defaults to 6 days instead of 1 weeķ, which is more
convenient for those who review weekly

- Thanks to Dirk Deimeke.
2017-02-05 15:03:13 +01:00
Paul Beckingham
09032052d1 review: Greater Core Guidelines compliance 2017-01-08 14:40:39 -05:00
Paul Beckingham
daecfec750 main: Greater Core Guidelines compliance 2017-01-08 14:40:22 -05:00
Paul Beckingham
9868566f8d help: Great Core Guidelines compliance 2017-01-08 14:34:00 -05:00
Paul Beckingham
ab7245cb8a shell: Clarifying comment 2017-01-08 14:33:03 -05:00
Paul Beckingham
a2a900d144 prompt: Greater C++11 compliance 2017-01-08 14:26:22 -05:00
Paul Beckingham
cc2e173d74 diag: Greater C++11 compliance 2017-01-08 14:17:26 -05:00
Paul Beckingham
fa79935c8b diag: Updated to libshared cppCompliance call 2017-01-08 14:13:50 -05:00
Paul Beckingham
c3d366ce78 libshared: Updated to bfb0e90e0c94918b86dd16d8b0e05a74bab8fb75 2017-01-08 14:13:31 -05:00
Paul Beckingham
0be6d781bd diag: Migrated to libshared osName 2017-01-08 12:21:00 -05:00
Paul Beckingham
f48b17cddb libshared: Updated to aff911bd080a05e5e12a240e13adb27f435b5bb2 2017-01-08 12:20:19 -05:00
Paul Beckingham
0f9a8e3877 TS-34: Tasksh throw a warning at the end of a review command
- Thanks to bjonnh.
2017-01-07 09:46:58 -05:00
Paul Beckingham
b3e4867a8d Cleanup: Removed unused file 2017-01-01 12:35:49 -05:00
Paul Beckingham
008f183bd1 Copyright update 2017-01-01 12:35:12 -05:00
Paul Beckingham
e967c874a2 Tests: Removed TASKD_USE_PATH 2016-11-22 10:21:35 -05:00
Paul Beckingham
13447e1bc8 Tests: Set sys.stdout as utf8 2016-11-21 22:32:15 -05:00
Paul Beckingham
b8debf69bc libshared: Updated to ce5c3414de56a2d1390893bbdc46e7116c38cd90 2016-11-19 13:53:10 -05:00
Paul Beckingham
ccd21f4060 TS-32: control-d to exit
- Thanks to Eric Hymowitz.
2016-11-11 17:48:26 -05:00
Paul Beckingham
346e8881e4 Portability: Missing include for Cygwin 2016-09-06 08:26:41 -04:00
Paul Beckingham
cc357231b3 TS-29: tasksh hangs trying to read task from stdin
- Thanks to ilove zfs.
2016-09-06 08:15:21 -04:00
Federico Hernandez
870881a61c Merge branch '1.2.0' of ssh://git.tasktools.org/ex/tasksh into 1.2.0 2016-09-05 23:23:21 +02:00
Federico Hernandez
dd1856e058 Removed README.md from docfiles to install 2016-09-05 23:23:08 +02:00
Paul Beckingham
a79664fffe Merge remote-tracking branch 'refs/remotes/origin/1.2.0' into 1.2.0 2016-09-05 16:47:13 -04:00
Paul Beckingham
5a4176ac1b Docs: Typo fix 2016-09-05 16:21:01 -04:00
Federico Hernandez
97897f6f90 Bumped version numbers in documentation 2016-09-05 21:51:12 +02:00
23 changed files with 106 additions and 171 deletions

2
.gitmodules vendored
View file

@ -1,3 +1,3 @@
[submodule "src/libshared"]
path = src/libshared
url = https://git.tasktools.org/scm/tm/libshared.git
url = https://github.com/GothenburgBitFactory/libshared

View file

@ -3,11 +3,14 @@ the following people:
Paul Beckingham (Principal Author)
Federico Hernandez (Principal Author)
Dirk Deimeke (Technical Advisor & Evangelist)
The following submitted code, packages or analysis, and deserve special thanks:
Jörg Krause
Ben Boeckel
ilove zfs
Paul Fenwick
Thanks to the following, who submitted detailed bug reports and excellent
suggestions:
@ -19,4 +22,7 @@ suggestions:
jonbobbly
hosaka
Lars Kumbier
Ian R. Learmonth
Iain R. Learmonth
Eric Hymowitz
bjonnh

View file

@ -63,7 +63,7 @@ if (EXISTS ${CMAKE_SOURCE_DIR}/test)
add_subdirectory (test EXCLUDE_FROM_ALL)
endif (EXISTS ${CMAKE_SOURCE_DIR}/test)
set (doc_FILES NEWS ChangeLog README.md INSTALL AUTHORS COPYING)
set (doc_FILES NEWS ChangeLog INSTALL AUTHORS COPYING)
foreach (doc_FILE ${doc_FILES})
install (FILES ${doc_FILE} DESTINATION ${TASKSH_DOCDIR})
endforeach (doc_FILE)

View file

@ -1,6 +1,6 @@
tasksh - a shell/frontend for the command line task list manager taskwarrior.
Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View file

@ -1,3 +1,15 @@
1.2.0 (2017-05-10) 3f4b2284ad19beacd30e202e6c700a36c2b65c60
- TS-29 tasksh hangs trying to read task from stdin
(thanks to ilove zfs).
- TS-32 control-d to exit
(thanks to Eric Hymowitz, Paul Fenwick).
- TS-34 Tasksh throw a warning at the end of a review command
(thanks to bjonnh).
- Review report now defaults to 6 days instead of 1 weeķ, which is more
convenient for those who review weekly
(thanks to Dirk Deimeke).
------ current release ---------------------------
1.1.0 (2016-09-06) 464f5ae19f853911e739c2489897aef64345c388
@ -11,7 +23,7 @@
- TS-24 add review option (m)odify
(thanks to David Patrick).
- TS-28 Please add a (m)odify feature for review
(thanks to Ian R. Learmonth).
(thanks to Iain R. Learmonth).
- Implemented 'review' command.
- Implemented 'diag' command.
- Added 'review N' option, to specify the number of tasks you would like to

View file

@ -1,6 +1,6 @@
tasksh - a shell/frontend for ithe command line task list manager taskwarrior.
Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

22
NEWS
View file

@ -1,29 +1,23 @@
New Features in tasksh 1.1.0
New Features in tasksh 1.2.0
- Support for a GTD-like review session.
- Responds to Ctrl-D by exiting.
New commands in tasksh 1.1.0
New commands in tasksh 1.2.0
- 'review' begins an interactive review session
- 'diag' shows diagnostic info for problem solving
-
New configuration options in tasksh 1.1.0
New configuration options in tasksh 1.2.0
- The 'tasksh.autoclear' setting in Taskwarrior is used by Tasksh to clear
the terminal before every command, if set to '1'.
-
Known Issues
- Spaces in project names in tasksh
https://bug.tasktools.org/browse/TS-3
- Tasksh throws errors on unescaped parentheses
https://bug.tasktools.org/browse/TS-23
-
Tasksh has been built and tested on the following configurations:
* OS X
* macOS
* Fedora
* Ubuntu
* Debian

View file

@ -1,3 +1,9 @@
# Installing
* Debian/Ubuntu:
```
$ sudo apt-get install tasksh
```
# Disclaimer during ongoing development
The development branch is a work in progress and may not pass all quality tests,
@ -15,3 +21,6 @@ Thank you for taking a look at tasksh!!
---
Tasksh is released under the MIT license. For details check the LICENSE file.
# Important note
When cloning this from the repo to build from source make sure you `git clone --recursive` to get all required submodules.

View file

@ -1,4 +1,4 @@
.TH tasksh 1 2016-09-06 "${PACKAGE_STRING}" "User Manuals"
.TH tasksh 1 2017-05-10 "${PACKAGE_STRING}" "User Manuals"
.SH NAME
tasksh \- Interactive taskwarrior shell
@ -144,7 +144,7 @@ If set to "1", causes each tasksh command to be preceded by a 'clear screen' and
cursor reset. Default is "0".
.SH "CREDITS & COPYRIGHTS"
Copyright (C) 2006 \- 2016 P. Beckingham, F. Hernandez.
Copyright (C) 2006 \- 2017 P. Beckingham, F. Hernandez.
This man page was originally written by Federico Hernandez.

View file

@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
// Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -48,33 +48,8 @@ int cmdDiagnostics ()
std::cout << "\n"
<< bold.colorize (PACKAGE_STRING)
<< "\n";
std::cout << " " << "Platform: "
<<
#if defined (DARWIN)
"Darwin"
#elif defined (SOLARIS)
"Solaris"
#elif defined (CYGWIN)
"Cygwin"
#elif defined (HAIKU)
"Haiku"
#elif defined (OPENBSD)
"OpenBSD"
#elif defined (FREEBSD)
"FreeBSD"
#elif defined (NETBSD)
"NetBSD"
#elif defined (LINUX)
"Linux"
#elif defined (KFREEBSD)
TRING_CMD_DIAG_COMPILER
#elif defined (GNUHURD)
"GNU/Hurd"
#else
"Unknown"
#endif
<< "\n"
<< " " << "Platform: " << osName ()
<< "\n\n";
// Compiler.
@ -114,18 +89,8 @@ TRING_CMD_DIAG_COMPILER
<< "\n";
// Compiler compliance level.
std::string compliance = "non-compliant";
#ifdef __cplusplus
int level = __cplusplus;
if (level == 199711)
compliance = "C++98/03";
else if (level == 201103)
compliance = "C++11";
else
compliance = format (level);
#endif
std::cout << " Compliance: "
<< compliance
<< cppCompliance ()
<< "\n\n";
std::cout << bold.colorize ("Build Features")
@ -161,7 +126,7 @@ TRING_CMD_DIAG_COMPILER
std::cout << bold.colorize ("Configuration")
<< "\n";
char* env = getenv ("TASKRC");
auto env = getenv ("TASKRC");
std::cout << " TASKRC: "
<< (env ? env : "")
<< "\n";
@ -175,12 +140,9 @@ TRING_CMD_DIAG_COMPILER
std::string path (getenv ("PATH"));
std::cout << " PATH: " << path << "\n";
std::vector <std::string> paths = split (path, ':');
std::vector <std::string>::iterator i;
for (i = paths.begin (); i != paths.end (); ++i)
for (const auto& i : split (path, ':'))
{
File task (*i + "/task");
File task (i + "/task");
if (task.exists ())
{
std::string input;
@ -188,8 +150,8 @@ TRING_CMD_DIAG_COMPILER
execute ("task", {"--version"}, input, output);
std::cout << "Taskwarrior: "
<< (*i + "/task")
<< " "
<< i
<< "/task "
<< output; // Still has \n
}
}

View file

@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
// Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -30,7 +30,7 @@
////////////////////////////////////////////////////////////////////////////////
int cmdHelp ()
{
std::cout << "\n"
std::cout << '\n'
<< " Commands:\n"
<< " tasksh> list Or any other Taskwarrior command\n"
<< " tasksh> review [N] Task review session, with optional cutoff after N tasks\n"
@ -38,10 +38,10 @@ int cmdHelp ()
<< " tasksh> help Tasksh help\n"
<< " tasksh> diagnostics Tasksh diagnostics\n"
<< " tasksh> quit End of session. May also use 'exit'\n"
<< "\n"
<< '\n'
<< "Run 'man tasksh' from your shell prompt.\n"
<< "Run '! man tasksh' from inside tasksh.\n"
<< "\n";
<< '\n';
return 0;
}

@ -1 +1 @@
Subproject commit 83f8ac2a0de4caba98472925ae710c5124ad61c3
Subproject commit f1a3cd6bfabfb083fe3c26f580a15c0d60a92ee9

View file

@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
// Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -29,7 +29,9 @@
#include <vector>
#include <string>
#include <cstring>
#include <cstdio>
#include <stdlib.h>
#include <unistd.h>
#include <shared.h>
#ifdef HAVE_READLINE
@ -67,6 +69,7 @@ const std::string getResponse (const std::string& prompt)
if (! line_read)
{
std::cout << "\n";
response = "<EOF>";
}
else
{
@ -83,6 +86,7 @@ const std::string getResponse (const std::string& prompt)
if (std::cin.eof () == 1)
{
std::cout << "\n";
response = "<EOF>";
}
#endif
@ -93,22 +97,27 @@ const std::string getResponse (const std::string& prompt)
static int commandLoop (bool autoClear)
{
// Compose the prompt.
std::string prompt = promptCompose ();
auto prompt = promptCompose ();
// Display prompt, get input.
std::string command = getResponse (prompt);
auto command = getResponse (prompt);
// Obey Taskwarrior's rc.tasksh.autoclear.
if (autoClear)
std::cout << "\033[2J\033[0;0H";
int status = 0;
if (command != "")
if (! isatty (fileno (stdin)) && command == "")
{
std::vector <std::string> args = split (command, ' ');
status = -1;
}
else if (command != "")
{
auto args = split (command, ' ');
// Dispatch command.
if (closeEnough ("exit", args[0], 3)) status = -1;
if (args[0] == "<EOF>") status = -1;
else if (closeEnough ("exit", args[0], 3)) status = -1;
else if (closeEnough ("quit", args[0], 3)) status = -1;
else if (closeEnough ("help", args[0], 3)) status = cmdHelp ();
else if (closeEnough ("diagnostics", args[0], 3)) status = cmdDiagnostics ();
@ -155,7 +164,9 @@ int main (int argc, const char** argv)
output == "yes\n" ||
output == "on\n");
welcome ();
if (isatty (fileno (stdin)))
welcome ();
while ((status = commandLoop (autoClear)) == 0)
;
}

View file

@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
// Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -29,8 +29,7 @@
#include <string>
#include <Color.h>
static const char* contextColors[] =
{
static std::vector <std::string> contextColors = {
"bold white on red",
"bold white on blue",
"bold white on green",
@ -40,8 +39,6 @@ static const char* contextColors[] =
"black on white",
};
#define NUM_COLORS (sizeof (contextColors) / sizeof (contextColors[0]))
static std::vector <std::string> contexts;
std::string composeContexts (bool pretty = false);
@ -73,21 +70,14 @@ int promptAdd (const std::string& context)
std::string composeContexts (bool pretty /* = false */)
{
std::string combined;
for (unsigned int i = 0; i < contexts.size (); ++i)
{
for (unsigned int i = 0; i < contexts.size (); i++)
if (pretty)
{
combined += (i ? " " : "")
combined += (combined != "" ? " " : "")
+ std::string ("\001")
+ Color::colorize ("\002 " + contexts[i] + " \001", contextColors[i % NUM_COLORS])
+ Color::colorize ("\002 " + contexts[i] + " \001", contextColors[i % contextColors.size ()])
+ "\002";
}
else
{
combined += (i ? " " : "") + contexts[i];
}
}
combined += (combined != "" ? " " : "") + contexts[i];
if (combined != "")
combined += ' ';
@ -103,9 +93,9 @@ std::string promptCompose ()
// TODO - The accumulated context, as colored tokens.
// TODO - sync status
// TODO - time
std::string decoration = composeContexts (true);
auto decoration = composeContexts (true);
if (decoration.length ())
return "task " + composeContexts (true) + "> ";
return "task " + decoration + "> ";
return "tasksh> ";
}

View file

@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
// Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -65,12 +65,6 @@ static unsigned int getWidth ()
width = buff[1];
}
// Ncurses does this, and perhaps we need to as well, to avoid a problem on
// Cygwin where the display goes right up to the terminal width, and causes
// an odd color wrapping problem.
// if (config.getBoolean ("avoidlastcolumn"))
// --width;
return width;
}
@ -137,7 +131,7 @@ static const std::string reviewStart (
unsigned int width)
{
std::string welcome = "The review process is important for keeping your list "
"accurate, so you are working on the right thing.\n"
"accurate, so you are working on the right tasks.\n"
"\n"
"For each task you are shown, look at the metadata. "
"Determine whether the task needs to be changed (enter "
@ -187,8 +181,7 @@ static const std::string banner (
////////////////////////////////////////////////////////////////////////////////
static const std::string menu ()
{
Color text ("color15 on gray6");
return text.colorize (" (Enter) Mark as reviewed, (s)kip, (e)dit, (m)odify, (c)omplete, (d)elete, (q)uit ") + " ";
return Color ("color15 on gray6").colorize (" (Enter) Mark as reviewed, (s)kip, (e)dit, (m)odify, (c)omplete, (d)elete, (q)uit ") + " ";
}
////////////////////////////////////////////////////////////////////////////////
@ -241,7 +234,7 @@ static void reviewLoop (const std::vector <std::string>& uuids, unsigned int lim
response = getResponse (menu ());
if (response == "e") { editTask (uuid); }
if (response == "m") { modifyTask (uuid); repeat = true; }
else if (response == "m") { modifyTask (uuid); repeat = true; }
else if (response == "s") { std::cout << "Skipped\n\n"; ++current; }
else if (response == "c") { completeTask (uuid); ++current; ++reviewed; }
else if (response == "d") { deleteTask (uuid); ++current; ++reviewed; }
@ -303,7 +296,7 @@ int cmdReview (const std::vector <std::string>& args, bool autoClear)
execute ("task", {"rc.confirmation:no", "rc.verbose:nothing", "config", "report._reviewed.columns", "uuid" }, input, output);
execute ("task", {"rc.confirmation:no", "rc.verbose:nothing", "config", "report._reviewed.sort", "reviewed+,modified+"}, input, output);
execute ("task", {"rc.confirmation:no", "rc.verbose:nothing", "config", "report._reviewed.filter",
"( reviewed.none: or reviewed.before:now-1week ) and ( +PENDING or +WAITING )" }, input, output);
"( reviewed.none: or reviewed.before:now-6days ) and ( +PENDING or +WAITING )" }, input, output);
}
}
@ -319,7 +312,7 @@ int cmdReview (const std::vector <std::string>& args, bool autoClear)
input, output);
// Review the set of UUIDs.
std::vector <std::string> uuids = split (Lexer::trimRight (output, "\n"), '\n');
auto uuids = split (Lexer::trimRight (output, "\n"), '\n');
reviewLoop (uuids, limit, autoClear);
return 0;
}

View file

@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
// Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@ -40,7 +40,7 @@ int cmdShell (const std::vector <std::string>& args)
combined = combined.substr (1);
system (combined.c_str ());
return 0;
return 0; // Ignore system return code.
}
////////////////////////////////////////////////////////////////////////////////

View file

@ -1,48 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// http://www.opensource.org/licenses/mit-license.php
//
////////////////////////////////////////////////////////////////////////////////
#ifndef INCLUDED_TEXT
#define INCLUDED_TEXT
#include <string>
#include <vector>
void wrapText (std::vector <std::string>&, const std::string&, const int, bool);
std::string trimLeft (const std::string& in, const std::string& t = " ");
std::string trimRight (const std::string& in, const std::string& t = " ");
std::string trim (const std::string& in, const std::string& t = " ");
bool extractLine (std::string&, const std::string&, int, bool, unsigned int&);
void split (std::vector<std::string>&, const std::string&, const char);
void join (std::string&, const std::string&, const std::vector<std::string>&);
std::string lowerCase (const std::string&);
bool compare (const std::string&, const std::string&, bool sensitive = true);
bool closeEnough (const std::string&, const std::string&, unsigned int minLength = 0);
const std::string format (int);
const std::string format (const std::string&, const std::string&);
const std::string format (const std::string&, int, int);
#endif
////////////////////////////////////////////////////////////////////////////////

View file

@ -12,6 +12,9 @@ from multiprocessing import cpu_count
from threading import Thread
from subprocess import call, Popen, PIPE
if sys.version_info > (3,):
import codecs
try:
# python 2
from Queue import Queue, Empty
@ -19,9 +22,6 @@ except ImportError:
# python 3
from queue import Queue, Empty
# Look for taskd in $PATH instead of task/src/
os.environ["TASKD_USE_PATH"] = "1"
TIMEOUT = .2
@ -60,7 +60,10 @@ def run_test(testqueue, outqueue, threadname):
class TestRunner(object):
def __init__(self):
self.threads = []
self.tap = open(cmd_args.tapfile, 'w')
if sys.version_info > (3,):
self.tap = open(cmd_args.tapfile, 'w', errors='ignore')
else:
self.tap = open(cmd_args.tapfile, 'w')
self._parallelq = Queue()
self._serialq = Queue()
@ -197,6 +200,9 @@ def parse_args():
def main():
if sys.version_info > (3,):
sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
runner = TestRunner()
runner.start()

View file

@ -1,6 +1,6 @@
###############################################################################
#
# Copyright 2006-2016, Paul Beckingham, Federico Hernandez.
# Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal

View file

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
# Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal

View file

@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
// Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal

View file

@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////////
//
// Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
// Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal

View file

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright 2006 - 2016, Paul Beckingham, Federico Hernandez.
# Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal