Skip to content
This repository was archived by the owner on Feb 22, 2020. It is now read-only.

Inquisitive Investigators #5

Merged
merged 187 commits into from
Jan 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
187 commits
Select commit Hold shift + click to select a range
e14c423
Update README.md
Den4200 Jan 17, 2020
d96928b
precommit hooks and pipenv
Den4200 Jan 17, 2020
2e9859c
Merge branch 'master' of https://github.com/Den4200/code-jam-6
Den4200 Jan 17, 2020
7b3c1b1
Fix README.md
Den4200 Jan 17, 2020
217fca6
test commit
Den4200 Jan 17, 2020
72e4ccb
'test'
DDematto Jan 17, 2020
c7cde08
test
DDematto Jan 17, 2020
8519d81
Added Base Structure and KV lang file
DDematto Jan 17, 2020
1cf9b4a
quick example of ids/references
DDematto Jan 17, 2020
469b1eb
pre-commit hooks
Den4200 Jan 17, 2020
d613f13
remove hooks
Den4200 Jan 17, 2020
f14fcbd
added windows kivy deps
Den4200 Jan 17, 2020
f74aa2a
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
Den4200 Jan 17, 2020
e671f25
Created basic setup of File Explorer
DDematto Jan 18, 2020
387bc7c
Updated Browser
DDematto Jan 18, 2020
2ff56a2
auto generate dirs/files
Den4200 Jan 18, 2020
20b2893
merge conflicts dealt with
Den4200 Jan 18, 2020
2128bee
fix odd stuff
Den4200 Jan 18, 2020
65e5f5c
fix odd stuff
Den4200 Jan 18, 2020
a6675ab
added ScrollView
DDematto Jan 18, 2020
d56d768
added slider
DDematto Jan 18, 2020
d902bc5
file browsing
Den4200 Jan 18, 2020
53eb633
not working atm but progress!
Den4200 Jan 18, 2020
5efb042
fixed!
Den4200 Jan 18, 2020
0213224
fixed back dir
Den4200 Jan 18, 2020
0de0620
Starting Individual Column Layout
DDematto Jan 18, 2020
5ebe110
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
Den4200 Jan 18, 2020
526aa9c
added Column layout structure & bug fixes
DDematto Jan 18, 2020
1688091
in the works
Den4200 Jan 18, 2020
98c340d
added Type field
DDematto Jan 18, 2020
b6bcbd1
Column bug fixes
DDematto Jan 18, 2020
d9caba5
Fix for Text Field Boundaries
DDematto Jan 18, 2020
423801c
refactor newfile class
Den4200 Jan 18, 2020
40f1030
Added Time Scale
DDematto Jan 18, 2020
97e934b
Updated Column Layout
DDematto Jan 18, 2020
49d1866
fix file structure & add bytes conversion
Den4200 Jan 18, 2020
4a28f9b
Updated Column Layout & Padding
DDematto Jan 18, 2020
dfe9fb4
refactor
Den4200 Jan 18, 2020
34d7da0
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
Den4200 Jan 18, 2020
4e79c3b
Ancient Theme
DDematto Jan 18, 2020
a88e5a1
retro font
Den4200 Jan 18, 2020
8c262e2
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
Den4200 Jan 18, 2020
32a50b8
change the rest of the text fonts
Den4200 Jan 18, 2020
284f7c6
added types
Den4200 Jan 18, 2020
6b3d31a
Refactor
DDematto Jan 18, 2020
50f10dd
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
DDematto Jan 18, 2020
2b3828b
fix type bug & refactor
Den4200 Jan 18, 2020
b216524
Resizing Fix
DDematto Jan 18, 2020
30de813
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
DDematto Jan 18, 2020
dde6dfd
Added Font back and Refactor
DDematto Jan 19, 2020
2d38815
changed back dir symbol
Den4200 Jan 19, 2020
8cd0f6f
Fixed Window size
DDematto Jan 19, 2020
a970f8b
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
Den4200 Jan 19, 2020
03dab19
current dir header done
Den4200 Jan 19, 2020
b6bb61d
Added Quit Popup
DDematto Jan 19, 2020
fc933c9
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
DDematto Jan 19, 2020
4b38185
Work on RecycleView
DDematto Jan 19, 2020
c428cf7
don't display dir sizes
Den4200 Jan 19, 2020
59208be
fixed minor bugs
DDematto Jan 19, 2020
7b9d384
Added About Popup, Fixed some Visuals
DDematto Jan 19, 2020
839f552
Added MKDIR Popup, Fixed minor Bugs, More Visualizations
DDematto Jan 19, 2020
b61a33c
Refactored Kivy Files, Footer Problem being worked on
DDematto Jan 19, 2020
f508b13
Fixed :P
DDematto Jan 19, 2020
1760899
terminal WIP
Den4200 Jan 19, 2020
4771bc6
Added Scroll to terminal and RecycleView
DDematto Jan 19, 2020
cdd1c17
scroll fix
Den4200 Jan 19, 2020
0a48d25
"fixed merge conflicts"
Den4200 Jan 19, 2020
22c5add
fix method override
Den4200 Jan 19, 2020
e8c3ee6
"fixed terminal and lag!!"
Den4200 Jan 20, 2020
da199fb
"refactor stdout
Den4200 Jan 20, 2020
a5d37b5
Started and Near finished Layout
DDematto Jan 20, 2020
f070617
Started and Near finished Layout
DDematto Jan 20, 2020
a13f05d
WIP still broken
Den4200 Jan 20, 2020
c6e6c06
Merge
Den4200 Jan 20, 2020
7227b4e
"Added Minor Fixes/Cannot Use Touch Event"
DDematto Jan 20, 2020
064945a
fix last line of terminal being covered
Den4200 Jan 20, 2020
341367a
"added auto terminal cursor focus and refactor"
Den4200 Jan 20, 2020
780cd72
recycle layout WIP
Den4200 Jan 20, 2020
c559f6b
File Change fixed
DDematto Jan 20, 2020
96f412f
"reorganized file structure"
Den4200 Jan 20, 2020
014e7b6
Fixed File Manager/ Header not working
DDematto Jan 20, 2020
fd6155e
No longer a parent in root directory
DDematto Jan 20, 2020
ba734db
"Merge branch rewrite into Monika"
Den4200 Jan 20, 2020
3856830
"added type hints"
Den4200 Jan 20, 2020
13a4a9b
Fixed File Header not working
DDematto Jan 20, 2020
772c2b1
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
DDematto Jan 20, 2020
42719ab
Fixed File Spacing & ALT fix for TXT overflow
DDematto Jan 20, 2020
9ae9456
"fixed popup overlap and refactored"
Den4200 Jan 20, 2020
4f98c02
"Added FileBrowser Double Click"
DDematto Jan 20, 2020
27b7db2
text editor WIP
Den4200 Jan 20, 2020
8d0518b
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
Den4200 Jan 20, 2020
a5be694
text editor WIP:
Den4200 Jan 21, 2020
ea98889
Added Select Tool
DDematto Jan 21, 2020
36faac2
Added Select System for FileManager
DDematto Jan 21, 2020
e1cf551
fixed file/dir selection
Den4200 Jan 21, 2020
94ede91
Updated Selection Tool
DDematto Jan 21, 2020
4aadebb
Merge branch 'fileSelect' into Monika
Den4200 Jan 21, 2020
ac99f8b
working directory changes now work in terminal
Den4200 Jan 22, 2020
9fce342
"Added MKDIR"
DDematto Jan 22, 2020
587c084
Starting work on Manager Refresh
DDematto Jan 22, 2020
8eb5e88
directories refresh after MKDIR; WARNING: disgusting code
Den4200 Jan 22, 2020
ec9326b
"File Check System"
DDematto Jan 22, 2020
608e138
Added Unselect Feature
DDematto Jan 22, 2020
2b5f1fd
Added Remove Function
DDematto Jan 22, 2020
a0f3760
"Added a special suprise :)"
DDematto Jan 22, 2020
244e96a
file/dir deletion WIP
Den4200 Jan 23, 2020
1d11cde
deletion works now. WARNING: disgusting code
Den4200 Jan 24, 2020
4b32a07
added file updating for right side after deletion
Den4200 Jan 24, 2020
54705a3
Updated Footer
DDematto Jan 24, 2020
acc95ce
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
DDematto Jan 24, 2020
aa28848
Updated Footer
DDematto Jan 24, 2020
271f68b
Fix for Footer Navigation
DDematto Jan 24, 2020
cb7a18d
Updated fix for footer
DDematto Jan 24, 2020
45df3e2
working on EventDispatcher & refactoring
Den4200 Jan 24, 2020
0b36697
Merge
Den4200 Jan 24, 2020
7ee296b
Fixed directory Overflow
DDematto Jan 24, 2020
bd026b7
decided event dispatcher would take too long to implement
Den4200 Jan 24, 2020
914ff51
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
Den4200 Jan 24, 2020
a8356fe
directory header overflow fixed
Den4200 Jan 24, 2020
2c3f603
Added UP/DWN Footer
DDematto Jan 24, 2020
227d164
Added Up/Dwn for Footer Bar
DDematto Jan 24, 2020
ff717e5
Quick fix for UP/DWN
DDematto Jan 24, 2020
4c7738f
refactor & fix merge conflicts
Den4200 Jan 24, 2020
1cbd9aa
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
Den4200 Jan 24, 2020
540a1ae
Added File Creation Popup
DDematto Jan 24, 2020
fdc303e
Fixed Development Configurations
DDematto Jan 24, 2020
a6aa9a2
fixed shortened directory issues
Den4200 Jan 24, 2020
d37d480
Merge
Den4200 Jan 24, 2020
7f39529
Rearranged Footer
DDematto Jan 24, 2020
ca36b6d
remove stdout/stderr redirect
Den4200 Jan 24, 2020
ef821b3
Added File Creation
DDematto Jan 25, 2020
7d4c075
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
DDematto Jan 25, 2020
f20ec77
finished text editor
Den4200 Jan 25, 2020
5462a4c
merge, refresh browser on file creation, & finish file editor
Den4200 Jan 25, 2020
1ec761a
Updated About
DDematto Jan 25, 2020
058a45c
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
DDematto Jan 25, 2020
2c63e49
fixed icon and window title
Den4200 Jan 25, 2020
fe0498b
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
Den4200 Jan 25, 2020
9ba44eb
moved about text to static/about.txt
Den4200 Jan 25, 2020
4dc45e7
Removed Screen Transition Updated Editor
DDematto Jan 25, 2020
e9d4623
Added File name to save Popup
DDematto Jan 25, 2020
0ffb560
Updated Popup
DDematto Jan 25, 2020
2a6c416
refactoring
Den4200 Jan 25, 2020
bc90285
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
Den4200 Jan 25, 2020
a34002c
further refactoring and fixing up editor
Den4200 Jan 25, 2020
0fe2891
refactored browser refreshing
Den4200 Jan 25, 2020
0efd5f4
both sides of the browser now refresh if they are in the same directory
Den4200 Jan 25, 2020
121c12a
Added Copy Function and Fixed a few Flake8 Issues
DDematto Jan 26, 2020
637ab2d
changed fonts
Den4200 Jan 26, 2020
cff4402
Merge
Den4200 Jan 26, 2020
10f5f1c
Added flake8 Fixes (Please View flake8)
DDematto Jan 26, 2020
f5b6fa6
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
DDematto Jan 26, 2020
746b458
Maybe RecycleView Fix
DDematto Jan 26, 2020
e1e7777
Updated Name/Type Shortening
DDematto Jan 26, 2020
008a716
allow file/dir names to be longer & explain error
Den4200 Jan 26, 2020
6726f9a
Updated Column Size
DDematto Jan 26, 2020
cd8b338
copy button WIP
Den4200 Jan 26, 2020
73d6d22
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
Den4200 Jan 26, 2020
dd54147
"Added Text Editor Zoom"
DDematto Jan 26, 2020
84d8bdf
Added Zooming Label in Footer
DDematto Jan 26, 2020
08a6a68
fix zoom in & copy WIP
Den4200 Jan 26, 2020
178db83
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
DDematto Jan 26, 2020
cb91591
Fixed Overscroll for Editor
DDematto Jan 26, 2020
30bc038
copy now works!
Den4200 Jan 26, 2020
b498351
fix copy error catch for no selection
Den4200 Jan 26, 2020
a817222
catch file/directory already existing errors for copy method
Den4200 Jan 26, 2020
29b4a8c
catch no permission error when trying to open a directory without per…
Den4200 Jan 26, 2020
9fff68d
"Fixed Terminal"
DDematto Jan 26, 2020
b78ca4f
Fixed Terminal overscroll
DDematto Jan 26, 2020
c0c1c6b
Added rename
DDematto Jan 26, 2020
a6b98b9
working on README
Den4200 Jan 26, 2020
5e8189e
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
Den4200 Jan 26, 2020
10e8ee6
Added DIRChoice Class
DDematto Jan 26, 2020
8e849c6
catch errors for rename
Den4200 Jan 26, 2020
f15bd31
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into M…
Den4200 Jan 26, 2020
e3a44d9
added path constants
Den4200 Jan 26, 2020
3edad38
test
DDematto Jan 26, 2020
ac9c5f6
Added more to Readme
DDematto Jan 26, 2020
c4b8797
Fixed icon
DDematto Jan 26, 2020
108f741
Fixed Resizing Lag
DDematto Jan 26, 2020
5aebc5c
added a photo viewer
Den4200 Jan 26, 2020
465914a
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into p…
Den4200 Jan 26, 2020
5c44c29
Not sure if I did anything more
DDematto Jan 26, 2020
1eff6e6
added footer for photo viewer
Den4200 Jan 26, 2020
f83efda
Merge branch 'Monika' of https://github.com/Den4200/code-jam-6 into p…
Den4200 Jan 26, 2020
d109d3d
update README.md & about.txt
Den4200 Jan 26, 2020
0a56bb1
fix README.md
Den4200 Jan 26, 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
6 changes: 3 additions & 3 deletions inquisitive-investigators/.flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[flake8]
max-line-length=100
exclude=.cache,.venv,.svn,CVS,.bzr,.hg,.git,__pycache__,.tox
[flake8]
max-line-length=100
exclude=.cache,.venv,.svn,CVS,.bzr,.hg,.git,__pycache__,.tox
9 changes: 9 additions & 0 deletions inquisitive-investigators/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: local
hooks:
- id: flake8
name: Flake8
entry: pipenv run lint
language: python
types: [python]
require_serial: true
22 changes: 22 additions & 0 deletions inquisitive-investigators/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
flake8 = "*"
pre-commit = "*"
flake8-bugbear = "*"
pylint = "*"

[packages]
kivy = "*"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should pin your dependencies to a specified version or at least to the next major update. This will prevent undefined behaviour for anyone using your project in future should breaking changes to dependencies be made.

kivy-deps-sdl2 = "*"
kivy-deps-glew = "*"

[requires]
python_version = "3.7"

[scripts]
lint = "python -m flake8"
precommit = "pre-commit install"
357 changes: 357 additions & 0 deletions inquisitive-investigators/Pipfile.lock

Large diffs are not rendered by default.

53 changes: 38 additions & 15 deletions inquisitive-investigators/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,38 @@
# Inquisitive Investigators

Please use this README to document your team's project. Make sure to include a general description, information on how to set-up and run your project, and anything else you think may be interesting for a README. The README is usually the first document people read when they visit a project on GitHub, so it's a good idea to make it appealing.

## Useful links

- **Code Jam Rules:** [https://pythondiscord.com/pages/code-jams/code-jam-6/rules/](https://pythondiscord.com/pages/code-jams/code-jam-6/rules/)

- **General Code Jam info:** [https://pythondiscord.com/pages/code-jams/code-jam-6/](https://pythondiscord.com/pages/code-jams/code-jam-6/)

- **Kivy:** [https://kivy.org/#home](https://kivy.org/#home)

## License

All projects will merged into our Code Jam repository, which uses the [MIT license](../LICENSE). Please make sure that if you add assets, the licenses of those assets are compatible with the MIT license.
# Rex Explorer - Inquisitive Investigators
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good readme.

![Rex Explorer](https://cdn.discordapp.com/attachments/666081160497070080/671036109337264148/Image.PNG)

## About

Hello and thanks for using Rex-Explorer! Made over the course of a week for CodeJam VI, Rex-Explorer is a TUI file explorer with a built in terminal and many other features!

#### Features
- Be able to experience what it was like to browse files and directories on your computer from the old days!

- A built in terminal? Yeah we were suprised too! Be able to change directories and even commit your own project to github!

- A built in editor too! What, did you just want to look at your files. See what it was like to edit files back in the old'n days!

- A built in photo viewer!? We added this in at the absolute last minute, and it's a great addition to the program.

- Create files and directories to utilize with the built in editor, terminal and file explorer.

- Rename and Copy files and directories across your browser.

## Installation

#### Users

- Install pipenv: `pip install pipenv`
- Install dependencies: `pipenv sync`
- Run the program: `python -m rex_explorer`

#### Developers

- Install pipenv: `pip install pipenv`
- Install dependencies: `pipenv sync --dev`

## License

The font we used is licensed under the [SIL Open Font Licesnse](https://www.fontspace.com/help/#license-17)

[![Code Jam Banner](https://raw.githubusercontent.com/python-discord/code-jam-6/master/ancient%20tech.png?token=AAQAKVPQ55SEFWYYLYO5YV26ETLTC)](#)
4 changes: 4 additions & 0 deletions inquisitive-investigators/rex_explorer/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .core.main import AncientTechApp

if __name__ == "__main__":
AncientTechApp().run()
10 changes: 10 additions & 0 deletions inquisitive-investigators/rex_explorer/core/controller.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file was planned for use, but we ran out of time
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be removed in that case.


from kivy.event import EventDispatcher


class Controller(EventDispatcher):
__events__ = (
'on_update',
'on_edit'
)
67 changes: 67 additions & 0 deletions inquisitive-investigators/rex_explorer/core/core.kv
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#:kivy 1.11.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good usage of Kivy language!

#:import NoTransition kivy.uix.screenmanager.NoTransition

<ScreenManager>:
transition: NoTransition()

<BrowserScreen>:
name: browser
Browser:
id: browser

<Browser>:
left_browser: left
right_browser: right
terminal: terminal
footer: footer

FileBrowser:
id: left
pos_hint: {'top': 1}
size_hint: .499,.8
FileBrowser:
id: right
pos_hint: {'top': 1,'right':1}
size_hint: .499,.8
Border:
pos_hint: {'top': .2}
size_hint: 1,.01
Terminal:
id: terminal
pos_hint: {'top': .19}
size_hint: 1,.15
Footer:
id: footer
pos_hint: {'top': .04}
size_hint: 1,.04

<Button>:
font_name: './rex_explorer/static/retro_font.ttf'
font_size: 11.5
background_normal: ''
background_color: (0,0,0,0)

<Label>:
font_name: './rex_explorer/static/retro_font.ttf'
font_size: 11.5

<Border>:
canvas.before:
Color:
rgb: 0.34,1,1
Rectangle:
size: root.size
pos: root.pos

<TextInput>:
canvas.before:
Color:
rgba:
((1,1,1,1)
if self.focus and not self._cursor_blink
else (0, 0, 0, 0))
Rectangle:
pos: self._cursor_visual_pos
size: root.cursor_width + 10, -self._cursor_visual_height
Color:
rgba: self.disabled_foreground_color if self.disabled else (self.hint_text_color if not self.text else self.foreground_color)
56 changes: 56 additions & 0 deletions inquisitive-investigators/rex_explorer/core/core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This file was planned for use, but we ran out of time

from typing import Any, Dict, List, Union
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good import grouping.


from kivy.uix.screenmanager import Screen
from kivy.uix.floatlayout import FloatLayout
from kivy.properties import ObjectProperty

from .controller import Controller
from .exceptions import InvalidBrowser


class BrowserScreen(Screen):
pass


class Browser(FloatLayout, Controller):
left_browser = ObjectProperty()
right_browser = ObjectProperty()
terminal = ObjectProperty()
footer = ObjectProperty()

def __init__(self, *args: Any, **kwargs: Any) -> None:
super(Browser, self).__init__(*args, **kwargs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is legacy syntax, should be super().__init__(*args, **kwargs)


def on_update(
self, browser_side: str,
state: int, files: List[str]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty minor, but this would be clearer with 1 argument per line, especially with the type hints adding noise.

) -> None:
if browser_side == 'left':
browser = self.left_browser

elif browser_side == 'right':
browser = self.right_browser

else:
raise InvalidBrowser(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not fully convinced this needs it's own exception. A ValueError or RuntimeError would suffice in may opinion.

'Browser position should be either "left" or "right"'
)

browser.recycle_view.update(state, files)

def on_edit(self) -> None:
pass

def get_headers(self) -> Dict[
str, Union[str, None]
]:
"""
Returns current directory headers
from each browser.
"""
return {
'left': self.left_browser.header.directory.text,
'right': self.right_browser.header.directory.text,
}
6 changes: 6 additions & 0 deletions inquisitive-investigators/rex_explorer/core/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class InvalidBrowser(Exception):
pass


class InvalidSelection(Exception):
pass
39 changes: 39 additions & 0 deletions inquisitive-investigators/rex_explorer/core/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
from kivy import Config

Config.set('kivy', 'window_icon', 'rex_explorer/static/icon.ico')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be converted to a local config file.

https://kivy.org/doc/stable/guide/config.html#local-configuration

Config.set('input', 'mouse', 'mouse,multitouch_on_demand')
Config.set('kivy', 'exit_on_escape', '0')
Config.set('graphics', 'minimum_width', '1300')
Config.set('graphics', 'minimum_height', '650')
Config.set('graphics', 'width', '1300')
Config.set('graphics', 'height', '650')

from kivy.app import App
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager

from .core import BrowserScreen
from ..footer.footer import Footer
from ..terminal.terminal import Terminal
from ..manager.browser import FileBrowser
from ..editor.editor import TextEditor
from ..photo_viewer.viewer import PhotoViewer
from ..utils.paths import CORE_KV

Builder.load_file(CORE_KV)


class Manager(ScreenManager):

def __init__(self, *args, **kwargs):
super(Manager, self).__init__(*args, **kwargs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Legacy syntax.

self.add_widget(BrowserScreen(name='browser'))
self.add_widget(TextEditor(name='text_editor'))
self.add_widget(PhotoViewer(name='photo_viewer'))


class AncientTechApp(App):

def build(self):
self.title = 'Rex Explorer'
return Manager()
61 changes: 61 additions & 0 deletions inquisitive-investigators/rex_explorer/editor/editor.kv
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#:kivy 1.11.1

<TextEditor>:
editor: editor
recycler: recycler
BoxLayout:
RecycleView:
effect_cls: "ScrollEffect"
viewclass: 'EditorIO'
id: recycler

EditorIO:
id: editor
root: root
font_name: './rex_explorer/static/retro_font.ttf'
font_size: 12
foreground_color: root.foreground_color
background_color: root.background_color
height: max(self.parent.height, self.minimum_height)
size_hint_y: None
F:
size_hint: 1,.05



<SavePopup>:
title: 'Save File?'
FloatLayout:
Label:
id: file
size_hint: .3,.1
pos_hint: {'center_x': .5, 'center_y': .7}
color: 0.34,1,1,1
Button:
size_hint: .3,.1
pos_hint: {'center_x': .3, 'center_y': .4}
text: '[ Save ]'
color: 0.34,1,1,1
on_press: root.save()
Button:
size_hint: .3,.1
pos_hint: {'center_x': .7, 'center_y': .4}
text: '[ Cancel ]'
color: 0.34,1,1,1
on_press: root.dismiss()

<F>:
canvas:
Color:
rgba: 0,0,0,.5
Rectangle:
size: self.size
pos: self.pos
BoxLayout:
orientation: 'horizontal'
Label:
text: 'ESC: Exit'
Label:
text: 'CTRL + S: Save'
Label:
text: 'CTRL +/-: Zoom In/Out'
34 changes: 34 additions & 0 deletions inquisitive-investigators/rex_explorer/editor/editor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from typing import Any

from kivy.lang import Builder
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.screenmanager import Screen
from kivy.properties import (
ObjectProperty,
StringProperty,
NumericProperty,
ColorProperty
)

from .editorIO import EditorIO
from ..utils.paths import EDITOR_KV, FONT

Builder.load_file(EDITOR_KV)


class TextEditor(Screen):
editor = ObjectProperty()
recycler = ObjectProperty()

foreground_color = ColorProperty((1, 1, 1, 1))
background_color = ColorProperty((0, 0, 0, 1))

font_name = StringProperty(FONT)
font_size = NumericProperty(12.5)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using kivy.metrics.sp(12.5) would be better to guarantee similar results on screens with different dpis.


def __init__(self, *args: Any, **kwargs: Any) -> None:
super(TextEditor, self).__init__(*args, **kwargs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Legacy.



class F(FloatLayout):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surely there must be a more intuitive name than this?

pass
Loading