Skip to content

Commit 3bbb3c4

Browse files
committed
Cleaning
1 parent 00346d8 commit 3bbb3c4

4 files changed

Lines changed: 17 additions & 51 deletions

File tree

Dockerfile

Lines changed: 0 additions & 24 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,21 @@ Never use code in this repo if you don't trust your players!
1414

1515
```toml
1616
[[http.rules]]
17-
host = "127.0.0.0/8"
17+
host = "$private"
1818
action = "allow" # change here deny to allow
1919
```
2020

2121
2. Install & start python language server
2222

23-
Choose one of the following:
24-
25-
Docker way:
26-
27-
```sh
28-
docker run -it -p 8080:8080 neumond/python-computer-craft
29-
```
30-
31-
Install & run manually:
32-
3323
```sh
34-
pip install computercraft
24+
python -m pip install computercraft
3525
python -m computercraft.server
3626
```
3727

3828
3. Start Minecraft, open up any computer and type:
3929

4030
```sh
41-
wget http://127.0.0.1:8080/ py
31+
wget http://127.0.0.1:8000 py
4232
py
4333
```
4434

@@ -121,4 +111,4 @@ p = import_file('/disk/program.py') # absolute
121111
m = import_file('lib.py', __file__) # relative to current file
122112
```
123113

124-
More examples can be found in this repository.
114+
More examples can be found in this repository: `examples/` and `tests/cc_programs/`

computercraft/sess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def fileno(self):
101101
else:
102102
# preventing use of gnu readline here
103103
# https://github.com/python/cpython/blob/master/Python/bltinmodule.c#L1970
104-
raise AttributeError
104+
return -1
105105

106106
def __getattr__(self, name):
107107
return getattr(self._native, name)

examples/args.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import argparse
22

3-
4-
# print(args)
5-
6-
7-
parser = argparse.ArgumentParser(prog=__file__, description='Process some integers.')
8-
parser.add_argument('integers', metavar='N', type=int, nargs='+',
9-
help='an integer for the accumulator')
10-
parser.add_argument('--sum', dest='accumulate', action='store_const',
11-
const=sum, default=max,
12-
help='sum the integers (default: find the max)')
13-
14-
args = parser.parse_args(args=args)
3+
parser = argparse.ArgumentParser(
4+
prog=__file__.decode('utf-8'),
5+
description='Process some integers.')
6+
parser.add_argument(
7+
'integers', metavar='N', type=int, nargs='+',
8+
help='an integer for the accumulator')
9+
parser.add_argument(
10+
'--sum', dest='accumulate', action='store_const',
11+
const=sum, default=max,
12+
help='sum the integers (default: find the max)')
13+
14+
args = parser.parse_args(args=[a.decode('utf-8') for a in args[2:]])
1515
print(args.accumulate(args.integers))

0 commit comments

Comments
 (0)