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

Commit d7b3150

Browse files
authored
Merge pull request #5 from Den4200/master
Inquisitive Investigators
2 parents 40c78e2 + 0a56bb1 commit d7b3150

38 files changed

+2839
-18
lines changed

inquisitive-investigators/.flake8

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[flake8]
2-
max-line-length=100
3-
exclude=.cache,.venv,.svn,CVS,.bzr,.hg,.git,__pycache__,.tox
1+
[flake8]
2+
max-line-length=100
3+
exclude=.cache,.venv,.svn,CVS,.bzr,.hg,.git,__pycache__,.tox
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: flake8
5+
name: Flake8
6+
entry: pipenv run lint
7+
language: python
8+
types: [python]
9+
require_serial: true

inquisitive-investigators/Pipfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[[source]]
2+
name = "pypi"
3+
url = "https://pypi.org/simple"
4+
verify_ssl = true
5+
6+
[dev-packages]
7+
flake8 = "*"
8+
pre-commit = "*"
9+
flake8-bugbear = "*"
10+
pylint = "*"
11+
12+
[packages]
13+
kivy = "*"
14+
kivy-deps-sdl2 = "*"
15+
kivy-deps-glew = "*"
16+
17+
[requires]
18+
python_version = "3.7"
19+
20+
[scripts]
21+
lint = "python -m flake8"
22+
precommit = "pre-commit install"

inquisitive-investigators/Pipfile.lock

Lines changed: 357 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inquisitive-investigators/README.md

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,38 @@
1-
# Inquisitive Investigators
2-
3-
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.
4-
5-
## Useful links
6-
7-
- **Code Jam Rules:** [https://pythondiscord.com/pages/code-jams/code-jam-6/rules/](https://pythondiscord.com/pages/code-jams/code-jam-6/rules/)
8-
9-
- **General Code Jam info:** [https://pythondiscord.com/pages/code-jams/code-jam-6/](https://pythondiscord.com/pages/code-jams/code-jam-6/)
10-
11-
- **Kivy:** [https://kivy.org/#home](https://kivy.org/#home)
12-
13-
## License
14-
15-
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.
1+
# Rex Explorer - Inquisitive Investigators
2+
![Rex Explorer](https://cdn.discordapp.com/attachments/666081160497070080/671036109337264148/Image.PNG)
3+
4+
## About
5+
6+
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!
7+
8+
#### Features
9+
- Be able to experience what it was like to browse files and directories on your computer from the old days!
10+
11+
- A built in terminal? Yeah we were suprised too! Be able to change directories and even commit your own project to github!
12+
13+
- 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!
14+
15+
- A built in photo viewer!? We added this in at the absolute last minute, and it's a great addition to the program.
16+
17+
- Create files and directories to utilize with the built in editor, terminal and file explorer.
18+
19+
- Rename and Copy files and directories across your browser.
20+
21+
## Installation
22+
23+
#### Users
24+
25+
- Install pipenv: `pip install pipenv`
26+
- Install dependencies: `pipenv sync`
27+
- Run the program: `python -m rex_explorer`
28+
29+
#### Developers
30+
31+
- Install pipenv: `pip install pipenv`
32+
- Install dependencies: `pipenv sync --dev`
33+
34+
## License
35+
36+
The font we used is licensed under the [SIL Open Font Licesnse](https://www.fontspace.com/help/#license-17)
37+
38+
[![Code Jam Banner](https://raw.githubusercontent.com/python-discord/code-jam-6/master/ancient%20tech.png?token=AAQAKVPQ55SEFWYYLYO5YV26ETLTC)](#)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from .core.main import AncientTechApp
2+
3+
if __name__ == "__main__":
4+
AncientTechApp().run()
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file was planned for use, but we ran out of time
2+
3+
from kivy.event import EventDispatcher
4+
5+
6+
class Controller(EventDispatcher):
7+
__events__ = (
8+
'on_update',
9+
'on_edit'
10+
)
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#:kivy 1.11.1
2+
#:import NoTransition kivy.uix.screenmanager.NoTransition
3+
4+
<ScreenManager>:
5+
transition: NoTransition()
6+
7+
<BrowserScreen>:
8+
name: browser
9+
Browser:
10+
id: browser
11+
12+
<Browser>:
13+
left_browser: left
14+
right_browser: right
15+
terminal: terminal
16+
footer: footer
17+
18+
FileBrowser:
19+
id: left
20+
pos_hint: {'top': 1}
21+
size_hint: .499,.8
22+
FileBrowser:
23+
id: right
24+
pos_hint: {'top': 1,'right':1}
25+
size_hint: .499,.8
26+
Border:
27+
pos_hint: {'top': .2}
28+
size_hint: 1,.01
29+
Terminal:
30+
id: terminal
31+
pos_hint: {'top': .19}
32+
size_hint: 1,.15
33+
Footer:
34+
id: footer
35+
pos_hint: {'top': .04}
36+
size_hint: 1,.04
37+
38+
<Button>:
39+
font_name: './rex_explorer/static/retro_font.ttf'
40+
font_size: 11.5
41+
background_normal: ''
42+
background_color: (0,0,0,0)
43+
44+
<Label>:
45+
font_name: './rex_explorer/static/retro_font.ttf'
46+
font_size: 11.5
47+
48+
<Border>:
49+
canvas.before:
50+
Color:
51+
rgb: 0.34,1,1
52+
Rectangle:
53+
size: root.size
54+
pos: root.pos
55+
56+
<TextInput>:
57+
canvas.before:
58+
Color:
59+
rgba:
60+
((1,1,1,1)
61+
if self.focus and not self._cursor_blink
62+
else (0, 0, 0, 0))
63+
Rectangle:
64+
pos: self._cursor_visual_pos
65+
size: root.cursor_width + 10, -self._cursor_visual_height
66+
Color:
67+
rgba: self.disabled_foreground_color if self.disabled else (self.hint_text_color if not self.text else self.foreground_color)
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# This file was planned for use, but we ran out of time
2+
3+
from typing import Any, Dict, List, Union
4+
5+
from kivy.uix.screenmanager import Screen
6+
from kivy.uix.floatlayout import FloatLayout
7+
from kivy.properties import ObjectProperty
8+
9+
from .controller import Controller
10+
from .exceptions import InvalidBrowser
11+
12+
13+
class BrowserScreen(Screen):
14+
pass
15+
16+
17+
class Browser(FloatLayout, Controller):
18+
left_browser = ObjectProperty()
19+
right_browser = ObjectProperty()
20+
terminal = ObjectProperty()
21+
footer = ObjectProperty()
22+
23+
def __init__(self, *args: Any, **kwargs: Any) -> None:
24+
super(Browser, self).__init__(*args, **kwargs)
25+
26+
def on_update(
27+
self, browser_side: str,
28+
state: int, files: List[str]
29+
) -> None:
30+
if browser_side == 'left':
31+
browser = self.left_browser
32+
33+
elif browser_side == 'right':
34+
browser = self.right_browser
35+
36+
else:
37+
raise InvalidBrowser(
38+
'Browser position should be either "left" or "right"'
39+
)
40+
41+
browser.recycle_view.update(state, files)
42+
43+
def on_edit(self) -> None:
44+
pass
45+
46+
def get_headers(self) -> Dict[
47+
str, Union[str, None]
48+
]:
49+
"""
50+
Returns current directory headers
51+
from each browser.
52+
"""
53+
return {
54+
'left': self.left_browser.header.directory.text,
55+
'right': self.right_browser.header.directory.text,
56+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class InvalidBrowser(Exception):
2+
pass
3+
4+
5+
class InvalidSelection(Exception):
6+
pass

0 commit comments

Comments
 (0)