chgksuite 0.27.0b3__py3-none-any.whl → 0.27.0b4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -78,7 +78,8 @@ def parse_filepath(filepath, args=None):
78
78
  with codecs.open(filepath, "r", "utf8") as input_file:
79
79
  input_text = input_file.read()
80
80
  input_text = input_text.replace("\r", "")
81
- return parse_4s(input_text, randomize=args.randomize, debug=args.debug)
81
+ debug_dir = os.path.dirname(os.path.abspath(filepath))
82
+ return parse_4s(input_text, randomize=args.randomize, debug=args.debug, debug_dir=debug_dir)
82
83
 
83
84
 
84
85
  def make_merged_filename(filelist):
@@ -1,9 +1,16 @@
1
1
  import codecs
2
+ import os
2
3
  import random
3
4
  import re
4
5
  from collections import defaultdict
5
6
 
6
- from chgksuite.common import QUESTION_LABELS, check_question, init_logger, log_wrap
7
+ from chgksuite.common import (
8
+ QUESTION_LABELS,
9
+ check_question,
10
+ get_chgksuite_dir,
11
+ init_logger,
12
+ log_wrap,
13
+ )
7
14
  from chgksuite.typotools import remove_excessive_whitespace as rew
8
15
 
9
16
  REQUIRED_LABELS = set(["question", "answer"])
@@ -89,7 +96,7 @@ def replace_counters(string_):
89
96
  return string_
90
97
 
91
98
 
92
- def parse_4s(s, randomize=False, debug=False, logger=None):
99
+ def parse_4s(s, randomize=False, debug=False, logger=None, debug_dir=None):
93
100
  logger = logger or init_logger("composer")
94
101
  mapping = {
95
102
  "#": "meta",
@@ -115,8 +122,11 @@ def parse_4s(s, randomize=False, debug=False, logger=None):
115
122
  if s[0] == "\ufeff" and len(s) > 1:
116
123
  s = s[1:]
117
124
 
118
- with codecs.open("raw.debug", "w", "utf8") as debugf:
119
- debugf.write(log_wrap(s.split("\n")))
125
+ if debug:
126
+ debug_dir = debug_dir or get_chgksuite_dir()
127
+ debug_path = os.path.join(debug_dir, "raw.debug")
128
+ with codecs.open(debug_path, "w", "utf8") as debugf:
129
+ debugf.write(log_wrap(s.split("\n")))
120
130
 
121
131
  s = replace_counters(s)
122
132
 
chgksuite/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.27.0b3"
1
+ __version__ = "0.27.0b4"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chgksuite
3
- Version: 0.27.0b3
3
+ Version: 0.27.0b4
4
4
  Summary: A package for chgk automation
5
5
  Author-email: Alexander Pecheny <ap@pecheny.me>
6
6
  License-Expression: MIT
@@ -6,10 +6,10 @@ chgksuite/parser.py,sha256=2UL-2dJtCFYEjakUfeh3n1E4epMKPo0pjdaC_cBZplM,45775
6
6
  chgksuite/parser_db.py,sha256=gh5AM80UR_hQ0r_-AwWLbqZCl2V0j3HAgj6BilImXyc,11116
7
7
  chgksuite/trello.py,sha256=I1JmIbZVJjJuuRO0g26fNt8deRo9hDlk1xBIf8w31Rs,14724
8
8
  chgksuite/typotools.py,sha256=0fQOjt5H3NRl0JeGTp2x-k-2ZN68E9Z9WX8D7lCwXmA,12765
9
- chgksuite/version.py,sha256=1PfujVHYVF7srJSn6DXPFkpAJHTDurCFxLyRIehyqJk,25
9
+ chgksuite/version.py,sha256=DrRQ0PRyZarER4yjID16e6Pnohc_hFKkfGU7t8aYz0M,25
10
10
  chgksuite/vulture_whitelist.py,sha256=P__p_X0zt10ivddIf81uyxsobV14vFg8uS2lt4foYpc,3582
11
- chgksuite/composer/__init__.py,sha256=MAOVZIYXmZmD6nNQSo9DueV6b5RgxF7_HGeLvsAhMJs,6490
12
- chgksuite/composer/chgksuite_parser.py,sha256=XxopZLVY4DQxgxw2a6NT70ga_2XZHzuvn58RnlriiqE,8847
11
+ chgksuite/composer/__init__.py,sha256=k6bnuB8ftPsBY-Q-iLm42S10jWXAJebmYTdW_BZiKAM,6570
12
+ chgksuite/composer/chgksuite_parser.py,sha256=g1KP0Jm4Zt4I06WGbFfKz6qIv4x1bLuPozu4QOV2wfw,9049
13
13
  chgksuite/composer/composer_common.py,sha256=kc-_Tc9NjevfXGj4fXoa9fye9AO0EuMSnEPJnS0n-aQ,16281
14
14
  chgksuite/composer/db.py,sha256=71cINE_V8s6YidvqpmBmmlWbcXraUEGZA1xpVFAUENw,8173
15
15
  chgksuite/composer/docx.py,sha256=W46glwffZFpIATrwe_100vl5ypobMwXADSfoaApyHl8,23716
@@ -54,9 +54,9 @@ chgksuite/resources/regexes_uz_cyr.json,sha256=D4AyaEPEY753I47Ky2Fwol_4kxQsl-Yu9
54
54
  chgksuite/resources/template.docx,sha256=Do29TAsg3YbH0rRSaXhVzKEoh4pwXkklW_idWA34HVE,11189
55
55
  chgksuite/resources/template.pptx,sha256=hEFWqE-yYpwZ8ejrMCJIPEyoMT3eDqaqtiEeQ7I4fyk,29777
56
56
  chgksuite/resources/trello.json,sha256=M5Q9JR-AAJF1u16YtNAxDX-7c7VoVTXuq4POTqYvq8o,555
57
- chgksuite-0.27.0b3.dist-info/licenses/LICENSE,sha256=_a1yfntuPmctLsuiE_08xMSORuCfGS8X5hQph2U_PUw,1081
58
- chgksuite-0.27.0b3.dist-info/METADATA,sha256=muUWnuAXvRsCjuwnkkKsES747wqhlLWTquzhmOm9ymk,1201
59
- chgksuite-0.27.0b3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
60
- chgksuite-0.27.0b3.dist-info/entry_points.txt,sha256=lqjX6ULQZGDt0rgouTXBuwEPiwKkDQkSiNsT877A_Jg,54
61
- chgksuite-0.27.0b3.dist-info/top_level.txt,sha256=cSWiRBOGZW9nIO6Rv1IrEfwPgV2ZWs87QV9wPXeBGqM,10
62
- chgksuite-0.27.0b3.dist-info/RECORD,,
57
+ chgksuite-0.27.0b4.dist-info/licenses/LICENSE,sha256=_a1yfntuPmctLsuiE_08xMSORuCfGS8X5hQph2U_PUw,1081
58
+ chgksuite-0.27.0b4.dist-info/METADATA,sha256=29tViwWEKfBijnHY-xp3Tra4b6ekmyPuMS5Zx1mmX3c,1201
59
+ chgksuite-0.27.0b4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
60
+ chgksuite-0.27.0b4.dist-info/entry_points.txt,sha256=lqjX6ULQZGDt0rgouTXBuwEPiwKkDQkSiNsT877A_Jg,54
61
+ chgksuite-0.27.0b4.dist-info/top_level.txt,sha256=cSWiRBOGZW9nIO6Rv1IrEfwPgV2ZWs87QV9wPXeBGqM,10
62
+ chgksuite-0.27.0b4.dist-info/RECORD,,