Skip to content

Commit a857931

Browse files
committed
wip renaming
1 parent 7a393cd commit a857931

9 files changed

+57
-57
lines changed

Diff for: Docs.cabal

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
name: Docs
2-
synopsis: Partial automation for updating the shortcut-demo docs
2+
synopsis: Partial automation for updating the ortholang-demo docs
33
author: Jeffrey David Johnson
44
maintainer: [email protected]
55
version: 0.1
66
license: AGPL-3
77
license-file: LICENSE
88
build-type: Simple
99
cabal-version: >=1.10
10-
data-files: shortcut/data/*.fa,
11-
shortcut/data/*.faa,
12-
shortcut/data/*.fna,
13-
shortcut/data/*.gbk,
14-
shortcut/data/*.txt,
15-
shortcut/docs/*.txt,
16-
shortcut/docs/modules/*.txt,
17-
shortcut/docs/types/*.txt,
18-
shortcut/docs/functions/*.txt,
19-
shortcut/tests/check/*.sh,
20-
shortcut/tests/versions/*.txt,
21-
shortcut/tests/repl/*.txt,
22-
shortcut/tests/scripts/*.cut,
23-
shortcut/tests/stdout/*.txt,
24-
shortcut/tests/tmpfiles/*.txt,
25-
shortcut/wrapper-scripts/*.sh
10+
data-files: ortholang/data/*.fa,
11+
ortholang/data/*.faa,
12+
ortholang/data/*.fna,
13+
ortholang/data/*.gbk,
14+
ortholang/data/*.txt,
15+
ortholang/docs/*.txt,
16+
ortholang/docs/modules/*.txt,
17+
ortholang/docs/types/*.txt,
18+
ortholang/docs/functions/*.txt,
19+
ortholang/tests/check/*.sh,
20+
ortholang/tests/versions/*.txt,
21+
ortholang/tests/repl/*.txt,
22+
ortholang/tests/scripts/*.cut,
23+
ortholang/tests/stdout/*.txt,
24+
ortholang/tests/tmpfiles/*.txt,
25+
ortholang/wrapper-scripts/*.sh
2626

2727
executable docs
2828
main-is: Docs.hs
2929
default-language: Haskell2010
3030
hs-source-dirs: .,
31-
shortcut
31+
ortholang
3232
build-depends: OrthoLang,
3333
Glob,
3434
MissingH,

Diff for: Docs.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module Main where
22

33
{- This isn't meant for end users. It's just an easy way to keep
44
- the module reference on the website in sync with the actual code.
5-
- Run shortcut --reference to generate an updated templates/reference.md
5+
- Run ortholang --reference to generate an updated templates/reference.md
66
-
77
- TODO put in a separate binary?
88
-}
@@ -115,7 +115,7 @@ writePlaceholder docsDir name = do
115115
putStrLn path
116116
writeFile path $ "doc for " ++ name ++ " not written yet"
117117

118-
-- TODO take one argument like: shortcut-docs ~/shortcut-demo/templates/reference.md
118+
-- TODO take one argument like: ortholang-docs ~/ortholang-demo/templates/reference.md
119119
main :: IO ()
120120
main = do
121121
writeDocPlaceholders modules

Diff for: common-names.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cd /mnt/data/PhytozomeV12
1010

1111
# i downloaded the portal pages with a firefox plugin since they require javascript
1212
# this moves them to their proper organism folders
13-
for f in /home/jefdaj/shortcut-demo/portals/*.html; do
13+
for f in /home/jefdaj/ortholang-demo/portals/*.html; do
1414
a=$(grep_alias "$f")
1515
# cp "$f" "${a}/portal.html" || echo "no dir: $a"
1616
d=early_release/$(ls early_release | grep $a)

Diff for: default.nix

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
let
22
# fetch my pinned nixpkgs for reproducibility
3-
# (shortcut-linux, dervived from nixpkgs-channels/nixos-19.09)
3+
# (ortholang-linux, dervived from nixpkgs-channels/nixos-19.09)
44
pkgs = let inherit (import <nixpkgs> {}) stdenv fetchFromGitHub; in import (fetchFromGitHub {
55
owner = "jefdaj";
66
repo = "nixpkgs";
@@ -10,7 +10,7 @@ let
1010
# use this instead to try to build it with your system's current nixpkgs:
1111
# pkgs = import <nixpkgs> {};
1212

13-
shortcut = import ./shortcut;
13+
ortholang = import ./ortholang;
1414
myPython = import ./requirements.nix { inherit pkgs; };
1515

1616
runDepends = [
@@ -23,13 +23,13 @@ let
2323
myPython.packages."misaka"
2424
myPython.packages."psutil"
2525
myPython.packages."pexpect"
26-
shortcut
26+
ortholang
2727
];
2828

2929
in pkgs.stdenv.mkDerivation rec {
3030
src = ./.;
3131
version = "0.1";
32-
name = "shortcut-demo-${version}";
32+
name = "ortholang-demo-${version}";
3333
inherit runDepends;
3434
buildInputs = [ pkgs.makeWrapper ] ++ runDepends;
3535
builder = pkgs.writeScript "builder.sh" ''
@@ -38,8 +38,8 @@ in pkgs.stdenv.mkDerivation rec {
3838
mkdir -p $out/src
3939
cp -R $src/templates $src/static $out/src
4040
mkdir -p $out/bin
41-
dest="$out/bin/shortcut-demo"
42-
install -m755 $src/shortcut-demo.py $dest
41+
dest="$out/bin/ortholang-demo"
42+
install -m755 $src/ortholang-demo.py $dest
4343
wrapProgram $dest --prefix PATH : "${pkgs.lib.makeBinPath runDepends}"
4444
'';
4545
}

Diff for: docs.nix

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
with import ./shortcut/nixpkgs;
1+
with import ./ortholang/nixpkgs;
22

33
let
4-
shortcut = import ./shortcut/default.nix;
4+
ortholang = import ./ortholang/default.nix;
55

6-
in haskell.lib.overrideCabal shortcut (drv: {
6+
in haskell.lib.overrideCabal ortholang (drv: {
77
buildDepends = drv.buildDepends ++ [stack];
88
shellHook = ''
99
${drv.shellHook or ""}

Diff for: genomes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,5 @@ def guess_type(path):
8888
# if 'Hannu' in d:
8989
# print j
9090
js.append(j)
91-
with open('/home/jefdaj/shortcut-demo/templates/genomes.json', 'w') as f:
91+
with open('/home/jefdaj/ortholang-demo/templates/genomes.json', 'w') as f:
9292
f.write(json.dumps(js, indent=2))

Diff for: service.nix

+10-10
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ with lib;
55
# TODO don't kill all python processes when stopping
66

77
let
8-
cfg = config.services.shortcutDemo;
8+
cfg = config.services.ortholangDemo;
99
pkgs2 = pkgs // {
1010
# adjust these to your system:
11-
shortcut = import ./shortcut;
12-
"shortcut-demo" = import ./default.nix;
11+
ortholang = import ./ortholang;
12+
"ortholang-demo" = import ./default.nix;
1313
};
1414

1515
in {
1616
options = {
17-
services.shortcutDemo = {
17+
services.ortholangDemo = {
1818
enable = mkOption {
1919
default = false;
2020
type = with types; bool;
@@ -32,15 +32,15 @@ in {
3232
};
3333

3434
authPath = mkOption {
35-
default = "/tmp/shortcut-users.txt"; # TODO where should this go by default?
35+
default = "/tmp/ortholang-users.txt"; # TODO where should this go by default?
3636
type = with types; uniq string;
3737
description = ''
3838
Path to the auth file (tab-separated usernames and passwords)
3939
'';
4040
};
4141

4242
logPath = mkOption {
43-
default = "/tmp/shortcut-demo.log";
43+
default = "/tmp/ortholang-demo.log";
4444
type = with types; uniq string;
4545
description = ''
4646
Where to write the server log.
@@ -65,7 +65,7 @@ in {
6565
};
6666

6767
tmpDir = mkOption {
68-
default = "/tmp/shortcut-demo";
68+
default = "/tmp/ortholang-demo";
6969
type = with types; uniq string;
7070
description = ''
7171
Where to save user tmpfiles. Ideally in RAM or at least on an SSD.
@@ -101,15 +101,15 @@ in {
101101
};
102102

103103
config = mkIf cfg.enable {
104-
systemd.services."shortcut-demo" = {
104+
systemd.services."ortholang-demo" = {
105105
wantedBy = [ "multi-user.target" ];
106106
after = [ "network.target" ];
107107
description = "OrthoLang demo server";
108108
serviceConfig = {
109109
Type = "simple";
110110
User = "${cfg.user}";
111111
ExecStart = ''
112-
${pkgs2.shortcut-demo}/bin/shortcut-demo \
112+
${pkgs2.ortholang-demo}/bin/ortholang-demo \
113113
-l ${cfg.logPath} \
114114
-e ${cfg.examplesDir} \
115115
-c ${cfg.commentsDir} \
@@ -124,6 +124,6 @@ in {
124124
};
125125
};
126126

127-
environment.systemPackages = [ pkgs2.shortcut pkgs2.procps ];
127+
environment.systemPackages = [ pkgs2.ortholang pkgs2.procps ];
128128
};
129129
}

Diff for: shortcut-demo.py

+14-14
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
Launch the OrthoLang demo server.
1212
1313
Usage:
14-
shortcut-demo (-h | --help)
15-
shortcut-demo -l LOG -e EXAMPLES -c COMMENTS -t TMP -p PORT -a AUTH -u USERS -s SHARED
14+
ortholang-demo (-h | --help)
15+
ortholang-demo -l LOG -e EXAMPLES -c COMMENTS -t TMP -p PORT -a AUTH -u USERS -s SHARED
1616
1717
Options:
1818
-h, --help Show this help text
@@ -81,7 +81,7 @@
8181
# repl sessions, indexed by sid and also username if logged in
8282
SESSIONS = {}
8383

84-
# prompt arrow, which should match the shortcut code
84+
# prompt arrow, which should match the ortholang code
8585
# ARROW = "❱❱❱ "
8686
# ARROW = "-> " # TODO does it need escaping in regexes?
8787
ARROW = u' —▶ '
@@ -106,7 +106,7 @@
106106

107107
# set up logging for this module
108108
# note: socketio + engineio loggers are messed with later
109-
LOGGER = LOGGING.getLogger('shortcut')
109+
LOGGER = LOGGING.getLogger('ortholang')
110110
LOGGER.setLevel(LOGGING.DEBUG)
111111
LOGGER.addHandler(HANDLER)
112112
LOGGER.info('starting demo.py')
@@ -379,7 +379,7 @@ def find_session(sid=None, username=None):
379379
return SESSIONS[sid]
380380

381381
def interpret_clear_code(sessionids, sometext):
382-
# remove terminal escape sequences like "clear screen" in shortcut
382+
# remove terminal escape sequences like "clear screen" in ortholang
383383
# based on https://stackoverflow.com/a/14693789
384384
ansi_clear = re.compile(r'\x1B\[2J')
385385
ansi_escape = re.compile(r'\x1B\[[0-?]*[ -/]*[@-~]')
@@ -507,22 +507,22 @@ def handle_reqresult():
507507

508508

509509
############
510-
# shortcut #
510+
# ortholang #
511511
############
512512

513-
def check_shortcut_version():
514-
LOGGER.info('checking output of "shortcut --version"')
513+
def check_ortholang_version():
514+
LOGGER.info('checking output of "ortholang --version"')
515515
version_expected = u'OrthoLang 0.9.2'
516-
proc = spawn('shortcut', ['--version'], encoding='utf-8', timeout=None)
516+
proc = spawn('ortholang', ['--version'], encoding='utf-8', timeout=None)
517517
try:
518518
proc.expect(version_expected, timeout=10)
519519
except:
520-
msg = '"shortcut --version" failed. Check your PATH and version.'
520+
msg = '"ortholang --version" failed. Check your PATH and version.'
521521
msg += ' It should be: ' + str(version_expected)
522522
LOGGER.error(msg)
523523
raise SystemExit(1)
524524

525-
check_shortcut_version()
525+
check_ortholang_version()
526526

527527
class OrthoLangThread(Thread):
528528
def __init__(self, sessionid, username):
@@ -557,7 +557,7 @@ def run(self):
557557
while True:
558558
index = self.process.expect(options)
559559
out = self.process.before + self.process.after
560-
out = interpret_clear_code(self.sessionids, out) # catches shortcut's "clear screen" command
560+
out = interpret_clear_code(self.sessionids, out) # catches ortholang's "clear screen" command
561561
self.emitText(out)
562562
# self.emitText(self.process.before.lstrip())
563563
# self.emitText(self.process.after)
@@ -570,7 +570,7 @@ def run(self):
570570
continue
571571

572572

573-
# TODO currently this is the same as killing the interpreter... handle separately in shortcut?
573+
# TODO currently this is the same as killing the interpreter... handle separately in ortholang?
574574
def stopEval(self):
575575
# LOGGER.info('session %s stopping %s evaluation' % (self.sessionid, self.process.pid))
576576
LOGGER.info('session %s stopping evaluation' % self.sessionids)
@@ -610,7 +610,7 @@ def spawnRepl(self):
610610
self.killRepl()
611611
args = ['--secure', '--noprogress', '--interactive', '--tmpdir', self.tmpdir, '--workdir', self.workdir, '--shared', CONFIG['shared_dir']]
612612
# self.process = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=STDOUT, preexec_fn=setsid)
613-
self.process = spawn('shortcut', args, encoding='utf-8', echo=False, timeout=None)
613+
self.process = spawn('ortholang', args, encoding='utf-8', echo=False, timeout=None)
614614
# LOGGER.info('session %s spawned interpreter %s' % (self.sessionid, self.process.pid))
615615
LOGGER.info('session %s spawned interpreter' % self.sessionids)
616616

Diff for: stack.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ nix:
77
extra-package-dbs: []
88
packages:
99
- .
10-
- shortcut
11-
- shortcut/logging
10+
- ortholang
11+
- ortholang/logging
1212

1313
# it works best if this matches the haskell.compiler.ghcXXX version in default.nix
1414
system-ghc: true

0 commit comments

Comments
 (0)