Skip to content

Commit

Permalink
Add license info per-file, adjust docs:
Browse files Browse the repository at this point in the history
Remove `COPYING` for being identified as "unknown", moved to readme
Few fixes to readme and contributing
More in TODO & dev-diary
  • Loading branch information
NaitLee committed Jul 7, 2022
1 parent fec31bd commit 403a234
Show file tree
Hide file tree
Showing 22 changed files with 180 additions and 40 deletions.
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"js/ts.implicitProjectConfig.strictNullChecks": false,
"js/ts.implicitProjectConfig.checkJs": false
}
24 changes: 13 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Contributing

Thank you for considering this project.
Thank you for looking into this project.

Let's keep short & be positive:

Expand Down Expand Up @@ -37,37 +37,39 @@ You can seek for help here, to do grammar extensions & leftovers.

3. Keep the existing "way". Here are details:

- Think about the Unix Philosophy before doing.
- Think about the Unix Philosophy before doing. Try to suck less.
- Follow coding style & naming convention.
- Consider the use cases, support Web UI and/or command-line backend
- Think about the use cases: Web UI and/or command-line backend, average and/or advanced users
- Test the code well. Document if necessary.
- Don't forget internationalization & necessary accessibility features.

4. Finally, "rules". Just skim these, don't feel pressure as I trust you won't mistake:

- Don't leak development/test cache/junk to the repo. Please.
And never put pictures/executables/any big binary to this repo. Try uploading to an issue/discussion instead.
- Don't connect to an online service to fetch resource.
And never put pictures/executables/any big binary to this repo. Try uploading in an issue/discussion instead.
- Don't connect to an online service to fetch resource.
If necessary, ask the user first.
- No more 3rd-party blackbox dependencies/assets, without explaining & using its most functionality.
Consider using existing system programs, or implementing it in your own.
Consider using existing system programs, or implementing enough from scratch.
If that really happened, make it optional (i.e. don't fail the load just for its non-existence),
And don't push the dependency source code.
For big dependencies, if you really love it, it's suggested to fork this repo & develop in your own way.
- Don't make anti-features. Don't be someone yourself dislike most. Examples:
- You can do: simple borders & stickers, simple PostScript interpreter, another common printing protocol
- Don't make anti-features. Don't be someone yourself dislike most.
Examples:
- You can do: simple borders & stickers, scribbling, simple PostScript interpreter, another common printing protocol
- Considering previous rule, discuss first: Bar/QR Code, formula, Native (non-Web) UI
- You shouldn't do: Way too fancy UI/editor, Cloud storage, camera integration & OCR
- Never consider: Accounting, non-free service integration, advertisement injection
- Never consider: online account, non-free service integration, analysis/telemetry
- Please don't violate the license (GNU General Public License version 3)
Modification to existing files are released under its existing license,
mostly GPL3 or CC0, according to statement in readme.
- If you want to preserve your copyright & use other license, create new file(s) for your work.
But, never release your code under any non-free license.

5. You can take any part of this project to do something else. It's still contribution!
5. You can take any part of this project to do something else. It's also contribution! Let the ideas spread!

## Footnote

Nothing could go wrong. Trust yourself & try your best.

Let's together build a better project, and a better world.
Let's together build it better. Thank you.
6 changes: 0 additions & 6 deletions COPYING

This file was deleted.

16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Currently:

| | |
|----|----|
| Supported | `GB0X, GT01, YT01` |
| Known to support | `GB0X, GT01, YT01` |

\* `X` represents any digit

Expand Down Expand Up @@ -117,10 +117,16 @@ Of course Pull Requests are welcome if you can handle them!

Copyright © 2021-2022 NaitLee Soft. Some rights reserved.

See file `COPYING`, `LICENSE`, and detail of used JavaScript in file `www/jslicense.html`
```
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 <https://www.gnu.org/licenses/>.
```

See file `LICENSE`, and detail of used JavaScript in file `www/jslicense.html`

Particularly, `printer.py`, `server.py` and `main.js` are released under GNU GPL 3.
All other parts, except which have special statements, are in Public Domain (CC0).
Particularly, `printer.py`, `server.py` and `main.js` are released under GNU GPL 3 (`GPL-3.0-or-later`).
All other parts, except which have special statements, are in Public Domain (`CC0-1.0-only`).

--------

Expand All @@ -142,4 +148,6 @@ Also interested in code development? See [development.md](development.md)!
- [AdvancedWebView](https://github.com/delight-im/Android-AdvancedWebView) for saving my life from Java
- Stack Overflow & the whole Internet, you let me know Android `Activity` all from beginning
... and many other helpful ideas as well
- Everyone that contributed through Issue/Pull Request/Discussion
- Everyone that is using this & caring about software freedom
- ... Everyone is Awesome!
10 changes: 8 additions & 2 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@ Note: not ordered. do whatever I/you want
+ Make error notice short while let users see detailed help/manual for what-to-do
+ Even better CUPS/IPP support
+ Even better frontend, language-friendly text printing
+ Tcl/Tk frontend. More in dev-diary.txt, July 7th.
+ Re-style frontend to make it usable in e.g. Otter Browser
+ Make a build guide for android:
Summary the hacks to p4a, bleak p4a recipe, p4a webview bootstrap, and AdvancedWebView
+ Try to implement enough without more dependencies
+ Plugin, for including community features
+ Arch Linux package / AUR, package for other distros
+ Service for other init systems (a systemd unit file is there)
+ ...

? Optimize PF2 text printing? It seems a bit slow (in algorithm).
? Built-in PostScript (Even if very basic)
? Data compression for GB03. Optional
? Plugin, for including community features (that involves usefulness but also bloatness)
It's usually messy. Try forking in your own way, at the moment.
? Process picture with WebAssembly? (Web frontend only)
? Put Android APP on F-Droid? But it needs automatic build system...
Android guys can help this!
? ... Or put to APKPure? But wait for good frontend before doing all of these
? ... Or put to APKPure? But make frontend well before doing all of these
48 changes: 48 additions & 0 deletions dev-diary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,51 @@ Took some misc things.
Made a minor change in `server.py`,
but resulting in MUCH faster server response...
I don't know what's the point. But it's great. Period.


... ... (went away for other ideas)

JULY

7th

In this period I've struggled about many bad things, notably Node.js.
That's the worst dev experience, ever. Darn it and luckily I didn't take it as my primary skill.

I'd tell less about; here is a place to start to know what's wrong with all of those:
http://harmful.cat-v.org/software/

(Don't take everything serious; what really matters is the philosophy: do one thing and do it well.)

I'm trying to balance it all the way. And look that in this small project:
how users are satisfied, average or advanced;
how developers contributed, novice or experienced.

Here is an unseen star of the galaxy, not even comparable to the megas.
But, settling here means that we are unique, and its existence is the best gift, to the world, to everyone.

Hope the spirit will persist.

----

After seeking around, I'll go farther. In my GitHub profile Bio there is a short description.

Here in this project, I have idea: Tcl/Tk
https://tcl.tk/

I want to make a path to communicate between that Python backend and a "better" frontend.
There's currently one, Web, but Web is too heavy in some cases, and I'm not that satisfied.
Tcl/Tk is a good choice. Python have Tkinter, but I don't go with it.

The simplest approach is shell/subprocess `python3 printer.py` at Tcl side.
Feel free to make one if you have experience & time, but I'd go in other way --

I want it through stdin/stdout of `wish`, the Tk shell.
Tk just do the UI, and echo interactions back (like when user click button, or input text)
The same can also be applied to Web, but maybe with frequent/delayed requests (or even WebSocket),
so that it become universal.
That may involve another (partial) rewrite.

Afraid not, experiment always worth it. And remember: it's all about idea, everyone can make use of then.

Yawn... bed time...
8 changes: 7 additions & 1 deletion printer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
'Cat-Printer: Core driver'
'''
Cat-Printer Core
Copyright © 2021-2022 NaitLee Soft. All rights reserved.
License GPL-3.0-or-later: https://www.gnu.org/licenses/gpl-3.0.html
'''

import os
import io
Expand Down
7 changes: 6 additions & 1 deletion printer_lib/commander.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
'Printer Commander'
'''
Cat-Printer Commander, way to communicate with cat printers via bluetooth
Copyright © 2021-2022 NaitLee Soft. No rights reserved.
License CC0-1.0-only: https://directory.fsf.org/wiki/License:CC0
'''

from abc import ABCMeta, abstractmethod

Expand Down
9 changes: 7 additions & 2 deletions printer_lib/i18n.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
'Minimal internationalization lib'
'''
Minimal internationalization
Copyright © 2021-2022 NaitLee Soft. No rights reserved.
License CC0-1.0-only: https://directory.fsf.org/wiki/License:CC0
'''

import os
import json
import locale

class I18nLib():
''' Minimal implementation of current frontend i18n in Python.
Not Complete (yet)!
Yet incomplete.
'''

lang: str
Expand Down
6 changes: 5 additions & 1 deletion printer_lib/ipp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
''' Provide *very* basic CUPS/IPP support
'''
Provide *very* basic CUPS/IPP support
Copyright © 2021-2022 NaitLee Soft. No rights reserved.
License CC0-1.0-only: https://directory.fsf.org/wiki/License:CC0
'''

import io
Expand Down
2 changes: 1 addition & 1 deletion printer_lib/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'Printer model specifications'
'Printer model specifications. License CC0-1.0-only'

class Model():
''' A printer model
Expand Down
10 changes: 7 additions & 3 deletions printer_lib/pf2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
''' Python lib for reading PF2 font files: http://grub.gibibit.com/New_font_format
I'd like to put it in Public Domain.
Don't forget to see how it's used in `text_print.py`
'''
Python lib for reading PF2 font files: http://grub.gibibit.com/New_font_format
Copyright © 2021-2022 NaitLee Soft. No rights reserved.
License CC0-1.0-only: https://directory.fsf.org/wiki/License:CC0
Don't forget to see how it's used in `text_print.py`
'''

import io
Expand Down
2 changes: 1 addition & 1 deletion printer_lib/text_print.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'Things used by Text Printing feature'
'Things used by Text Printing feature. License CC0-1.0-only'

from .pf2 import PF2S

Expand Down
10 changes: 9 additions & 1 deletion readme.i18n/README.de_DE.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,15 @@ Natürlich sind PRs willkommen, wenn Sie sie meistern können!

Copyright © 2021-2022 NaitLee Soft. Einige Rechte sind vorbehalten.

Siehe Datei `COPYING`, `LICENSE` und Details zum verwendeten JavaScript in der Datei `www/jslicense.html`.
```
Dieses Programm ist Freie Software: Sie können es unter den Bedingungen der GNU General Public License, wie von der Free Software Foundation, Version 3 der Lizenz oder (nach Ihrer Wahl) jeder neueren veröffentlichten Version, weiter verteilen und/oder modifizieren.
Dieses Programm wird in der Hoffnung bereitgestellt, dass es nützlich sein wird, jedoch OHNE JEDE GEWÄHR,; sogar ohne die implizite Gewähr der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK. Siehe die GNU General Public License für weitere Einzelheiten.
Sie sollten eine Kopie der GNU General Public License zusammen mit diesem Programm erhalten haben. Wenn nicht, siehe <https://www.gnu.org/licenses/>.
```

Siehe Datei `LICENSE` und Details zum verwendeten JavaScript in der Datei `www/jslicense.html`.

--------

Expand Down
16 changes: 12 additions & 4 deletions readme.i18n/README.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

| | |
|----|----|
| 支持 | `GB0X, GT01, YT01` |
| 已知支持 | `GB0X, GT01, YT01` |

\* `X` 表示任意数字

Expand Down Expand Up @@ -115,10 +115,16 @@ python3 server.py

Copyright © 2021-2022 NaitLee Soft. 保留一些权利。

敬请查看文件 `COPYING``LICENSE`,以及在 `www/jslicense.html` 中有关 JavaScript 许可的详细内容。
```
本程序是自由软件:你可以再分发之和/或依照由自由软件基金会发布的 GNU 通用公共许可证修改之,无论是版本 3 许可证,还是(按你的决定)任何以后版都可以。
发布该程序是希望它能有用,但是并无保障;甚至连可销售和符合某个特定的目的都不保证。请参看 GNU 通用公共许可证,了解详情。
你应该随程序获得一份 GNU 通用公共许可证的复本。如果没有,请看 <https://www.gnu.org/licenses/>。
```

敬请查看文件 `LICENSE`,以及在 `www/jslicense.html` 中有关 JavaScript 许可的详细内容。

具体地,`printer.py``server.py``main.js` 以 GNU GPL 3 发布。
其余所有部分,若无特殊声明,均在公有领域(CC0)。
具体地,`printer.py``server.py``main.js` 以 GNU GPL 3 发布`GPL-3.0-or-later`
其余所有部分,若无特殊声明,均在公有领域(`CC0-1.0-only`)。

--------

Expand All @@ -143,4 +149,6 @@ Copyright © 2021-2022 NaitLee Soft. 保留一些权利。
- [AdvancedWebView](https://github.com/delight-im/Android-AdvancedWebView) 从 Java 拯救了我的生命
- Stack Overflow 和整个互联网,你们让我从零开始了解了安卓“活动” `Activity`
……当然还有其他方面的帮助
- 每一位贡献于 Issue/Pull Request/Discussion 的人
- 每一位使用此作品并关心软件自由的人
- ……每个人都是好样的!
8 changes: 7 additions & 1 deletion server.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
'Cat Printer - Serve a Web UI'
'''
Cat-Printer: Web Interface Server
Copyright © 2021-2022 NaitLee Soft. All rights reserved.
License GPL-3.0-or-later: https://www.gnu.org/licenses/gpl-3.0.html
'''

# if pylint is annoying you, see file .pylintrc

Expand Down
5 changes: 5 additions & 0 deletions www/accessibility.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
`
Copyright © 2021-2022 NaitLee Soft. No rights reserved.
License CC0-1.0-only: https://directory.fsf.org/wiki/License:CC0
`;

'use strict';

Expand Down
5 changes: 5 additions & 0 deletions www/i18n-ext.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
`
Copyright © 2021-2022 NaitLee Soft. No rights reserved.
License CC0-1.0-only: https://directory.fsf.org/wiki/License:CC0
`;

///<reference path="i18n.d.ts" />

Expand Down
5 changes: 5 additions & 0 deletions www/i18n.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
`
Copyright © 2021-2022 NaitLee Soft. No rights reserved.
License CC0-1.0-only: https://directory.fsf.org/wiki/License:CC0
`;

'use strict';

Expand Down
5 changes: 5 additions & 0 deletions www/loader.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
`
Copyright © 2021-2022 NaitLee Soft. No rights reserved.
License CC0-1.0-only: https://directory.fsf.org/wiki/License:CC0
`;

/**
* Satisfy both development and old-old webView need
Expand Down
7 changes: 7 additions & 0 deletions www/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
`
Cat-Printer: Web Frontend
Copyright © 2021-2022 NaitLee Soft. All rights reserved.
License GPL-3.0-or-later: https://www.gnu.org/licenses/gpl-3.0.html
`;

'use strict';

Expand Down
7 changes: 6 additions & 1 deletion www/polyfill.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
`
Copyright © 2021-2022 NaitLee Soft. No rights reserved.
License CC0-1.0-only: https://directory.fsf.org/wiki/License:CC0
`;

// Polyfills

// home-made minimal fetch
// Note: only useful with this application. Extend (or remove) it as needed.
// In fact I wanted to support Otter Browser for resource-concerning people
// But it still can't cope with few other JS (even after transpiled to es5) and CSS variables
if (!window.fetch) window.fetch = function(url, options) {
options = options || {};
return new Promise(function(resolve, reject) {
Expand Down

0 comments on commit 403a234

Please sign in to comment.