-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
restructure to allow easy adding of generators
- Loading branch information
1 parent
390098e
commit 270bcbc
Showing
15 changed files
with
1,909 additions
and
1,628 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import os.path | ||
|
||
|
||
class QuickDERgeneric(object): | ||
def __init__(self, outfn, outext): | ||
self.unit, curext = os.path.splitext(outfn) | ||
if curext == '.h': | ||
raise Exception('File cannot overwrite itself -- use another extension than ' + outext + ' for input files') | ||
self.outfile = open(self.unit + outext, 'w') | ||
|
||
self.comma1 = None | ||
self.comma0 = None | ||
|
||
def write(self, txt): | ||
self.outfile.write(txt) | ||
|
||
def writeln(self, txt=''): | ||
self.outfile.write(txt + '\n') | ||
|
||
def newcomma(self, comma, firstcomma=''): | ||
self.comma0 = firstcomma | ||
self.comma1 = comma | ||
|
||
def comma(self): | ||
self.write(self.comma0) | ||
self.comma0 = self.comma1 | ||
|
||
def getcomma(self): | ||
return self.comma1, self.comma0 | ||
|
||
def setcomma(self, comma1, comma0): | ||
self.comma1 = comma1 | ||
self.comma0 = comma0 | ||
|
||
def close(self): | ||
self.outfile.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Stubs for quick_der.generators (Python 3.6) | ||
# | ||
# NOTE: This dynamically typed stub was automatically generated by stubgen. | ||
|
||
from typing import Any | ||
|
||
class QuickDERgeneric: | ||
outfile: Any = ... | ||
comma1: Any = ... | ||
comma0: Any = ... | ||
def __init__(self, outfn, outext) -> None: ... | ||
def write(self, txt): ... | ||
def writeln(self, txt: str = ...): ... | ||
def newcomma(self, comma, firstcomma: str = ...): ... | ||
def comma(self): ... | ||
def getcomma(self): ... | ||
def setcomma(self, comma1, comma0): ... | ||
def close(self): ... |
Oops, something went wrong.