Skip to content

Commit 638c2b2

Browse files
committed
Merge branch 'develop'
2 parents e9926d1 + 7f103fe commit 638c2b2

File tree

99 files changed

+347
-101
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+347
-101
lines changed

.editorconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,3 @@ indent_size = 4
2525
[*.tmPreferences]
2626
indent_style = tab
2727
indent_size = 4
28-
29-
[Makefile]
30-
indent_style = tab

.gitattributes

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
# Files and directories with the attribute export-ignore won’t be added to
66
# archive files. See http://git-scm.com/docs/gitattributes for details.
7-
/.github/ export-ignore
8-
/build/ export-ignore
9-
/icons/svg/ export-ignore
10-
/tests/ export-ignore
11-
/.editorconfig export-ignore
12-
/.flake8 export-ignore
13-
/.gitattributes export-ignore
14-
/.gitignore export-ignore
15-
/makefile export-ignore
16-
/pyproject.toml export-ignore
7+
/.github/ export-ignore
8+
/build/ export-ignore
9+
/icons/svg/ export-ignore
10+
/tests/ export-ignore
11+
/.editorconfig export-ignore
12+
/.flake8 export-ignore
13+
/.gitattributes export-ignore
14+
/.gitignore export-ignore
15+
/pyproject.toml export-ignore
16+
/requirements-dev.txt export-ignore

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
<!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
2525
- [ ] My code follows the code style of this project.
2626
- [ ] My change requires a change to the documentation.
27-
- [ ] I have read the **CONTRIBUTING** document.
27+
- [ ] I have read the [**CONTRIBUTING**](https://github.com/SublimeText/AFileIcon/blob/develop/CONTRIBUTING.md) document.

.github/workflows/ci.yaml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@ on: [push, pull_request]
33

44
jobs:
55
build:
6-
76
runs-on: ubuntu-latest
7+
88
steps:
9-
- uses: actions/checkout@v1
9+
- name: Checkout the latest code
10+
uses: actions/checkout@v4
11+
1012
- name: Set up Python
11-
uses: actions/setup-python@v1
13+
uses: actions/setup-python@v5
1214
with:
13-
python-version: 3.8
14-
- name: Install black
15-
run: pip install black
16-
- name: Check formating
17-
run: black --check .
15+
python-version-file: '.python-version'
16+
17+
- name: Install dependencies
18+
run: python -m pip install -U -r requirements-dev.txt
1819

20+
- name: Check formatting
21+
run: python -m black --check .
File renamed without changes.

.github/CONTRIBUTING.md renamed to CONTRIBUTING.md

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,57 +12,72 @@ We have very precise rules over how our git commit messages can be formatted. Th
1212

1313
We use [**Angular JS commit guidelines**](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-git-commit-guidelines) (except scope notes: we don't need them).
1414

15-
## Building
15+
## Development
1616

17-
## Prerequisites
17+
### Prerequisites
1818

19-
This package provides the `build` python package to create the preferences and icons. In order to add new icons a _python 3_ interpreter is required.
19+
The CairoSVG dependency needs the `cairo` library being present on the system.
2020

21-
The `build` uses [pyPNG](https://pypi.org/project/pypng/) and [CairoSVG](https://pypi.org/project/CairoSVG/) to convert the icons from SVG to PNG. You nee to...
21+
**Linux**
2222

2323
```bash
24-
pip install cairosvg
25-
pip install pypng
24+
sudo apt-get install libcairo2
2625
```
2726

28-
The CairoSVG needs the `cairo` library being present on the system.
27+
**Windows**
2928

30-
**Linux**
29+
You can download the latest release of [`cairo.dll`](https://github.com/preshing/cairo-windows/releases) and place it somewhere Python can load it from.
30+
31+
As a last resort, [Graphviz](https://graphviz.org/) includes `cairo.dll` in its distribution.
32+
33+
### Installation
34+
35+
Navigate to _A File Icon_ root directory and call...
36+
37+
**Linux/MacOS**
3138

3239
```bash
33-
sudo apt-get install libcairo2
40+
python3 -m venv .venv
41+
. .venv/bin/activate
42+
python3 -m pip install -U -r requirements-dev.txt
3443
```
3544

3645
**Windows**
3746

38-
You can download the latest release of the [cairo.dll](https://github.com/preshing/cairo-windows/releases) from https://github.com/preshing/cairo-windows/releases and place it somewhere python can load it from.
47+
```cmd
48+
py -m venv .venv
49+
.venv\Scripts\activate
50+
py -m pip install -U -r requirements-dev.txt
51+
```
3952

4053
### Building
4154

42-
Run the build scripts via makefile:
55+
Navigate to _A File Icon_ root directory, activate python virtual environment and call...
56+
57+
**Linux/MacOS**
4358

4459
```bash
45-
# build all
46-
make all
60+
# build everything
61+
python3 build
4762

48-
# build icons
49-
make icons
63+
# build icons only
64+
python3 build --icons
5065

51-
# build preferences
52-
make preferences
66+
# build preferences only
67+
python3 build --preferences
5368
```
5469

55-
If no make is available run the build scripts directly via python:
70+
**Windows**
5671

57-
```bash
58-
# build all
59-
python -u build --icons --preferences
72+
```cmd
73+
: build everything
74+
py build
6075
61-
# build icons
62-
python -u build --icons
76+
: build icons only
77+
py build --icons
6378
64-
# build preferences
65-
python -u build --preferences
79+
: build preferences only
80+
py build --preferences
6681
```
6782

6883
## Want to add new icons?

.sublime/Default.sublime-commands renamed to Default.sublime-commands

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"caption": "Preferences: A File Icon Settings",
44
"command": "edit_settings", "args":
55
{
6-
"base_file": "${packages}/A File Icon/.sublime/A File Icon.sublime-settings",
6+
"base_file": "${packages}/A File Icon/A File Icon.sublime-settings",
77
"default": "// A File Icon Preferences – User\n// ================================================================\n{\n\t$0\n}\n"
88
}
99
}

.sublime/Main.sublime-menu renamed to Main.sublime-menu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"caption": "Settings",
1616
"command": "edit_settings",
1717
"args": {
18-
"base_file": "${packages}/A File Icon/.sublime/A File Icon.sublime-settings",
18+
"base_file": "${packages}/A File Icon/A File Icon.sublime-settings",
1919
"default": "// A File Icon Preferences – User\n// ================================================================\n{\n\t$0\n}\n"
2020
}
2121
},

PACKAGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ This file contains a list of possible packages you may need to install to see th
2020

2121
- [Ansible](https://packagecontrol.io/packages/Ansible)
2222

23+
## ANTLR
24+
25+
- [ANTLR syntax highlight](https://packagecontrol.io/packages/ANTLR%20syntax%20highlight)
26+
2327
## Arduino
2428

2529
- [Arduino](https://packagecontrol.io/packages/Arduino)
File renamed without changes.

build/__main__.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,21 @@ def main(argv=None):
1616
"-p", "--preferences", action="store_true", help="create preferences"
1717
)
1818

19+
with open(icons_path("icons.json")) as fp:
20+
icons = json.load(fp)
21+
1922
options = parser.parse_args(argv)
2023
if not options.icons and not options.preferences:
21-
return parser.print_help()
24+
options.icons = True
25+
options.preferences = True
2226

23-
with open(icons_path("icons.json")) as fp:
24-
icons = json.load(fp)
27+
if options.preferences:
28+
print("building preferences...")
29+
create_preferences(icons)
2530

2631
if options.icons:
2732
print("building icons...")
2833
create_icons(icons)
29-
if options.preferences:
30-
print("building preferences...")
31-
create_preferences(icons)
3234

3335

3436
if __name__ == "__main__":

build/icons.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,10 @@
1+
import cairosvg
12
import json
23
import os
4+
import png
35
import re
46
import subprocess
57

6-
try:
7-
import cairosvg
8-
except ImportError:
9-
print(
10-
"Error: CairoSVG not installed!\n"
11-
" Run `pip install cairosvg`!\n"
12-
" Windows users need the cairo.dll from"
13-
" https://github.com/preshing/cairo-windows/releases"
14-
)
15-
16-
try:
17-
import png
18-
except ImportError:
19-
print(
20-
"Error: pyPNG not installed!\n"
21-
" Run `pip install pypng`!"
22-
)
23-
248

259
PACKAGE_ROOT = os.path.dirname(os.path.dirname(__file__))
2610

core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
def add_listener():
1818
log("Initializing settings")
19-
path = "Packages/{0}/.sublime/{1}".format(PACKAGE_NAME, PACKAGE_SETTINGS)
19+
path = "Packages/{0}/{1}".format(PACKAGE_NAME, PACKAGE_SETTINGS)
2020
settings = sublime.load_settings(PACKAGE_SETTINGS)
2121
for key in sublime.decode_value(sublime.load_resource(path)).keys():
2222
if key not in ("dev_mode", "dev_trace"):

0 commit comments

Comments
 (0)