Skip to content

Commit

Permalink
Fix #166
Browse files Browse the repository at this point in the history
  • Loading branch information
dputhier committed Nov 2, 2021
1 parent 3490f4b commit 9390ee5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions pygtftk/gtf_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
from pyparsing import Optional
from pyparsing import ParseResults
from pyparsing import Word
from pyparsing import infixNotation
from pyparsing import nums
from pyparsing import oneOf
from pyparsing import opAssoc
from pyparsing import operatorPrecedence

import pygtftk
import pygtftk.utils
Expand Down Expand Up @@ -925,7 +925,7 @@ def tail(self, nb=6, returned=False):
return msg
else:
print(msg)

def __repr__(self):
"""
Returns a printable representation of the GTF object.
Expand Down Expand Up @@ -2063,9 +2063,9 @@ def _embed(s, l, t):
group_1 = identifier + comparison_operator + value
group_2 = value + comparison_operator + identifier
comparison = group_1 | group_2
boolean_expr = operatorPrecedence(comparison,
[(and_operator, 2, opAssoc.LEFT),
(or_operator, 2, opAssoc.LEFT)])
boolean_expr = infixNotation(comparison,
[(and_operator, 2, opAssoc.LEFT),
(or_operator, 2, opAssoc.LEFT)])

boolean_expr_par = lparen + boolean_expr + rparen

Expand Down
20 changes: 10 additions & 10 deletions pygtftk/utils.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
"""A set of useful functions."""

import datetime
import glob
import io
import os
import random
import re
import string
import sys
import time
from collections import defaultdict, OrderedDict
from distutils.spawn import find_executable
from subprocess import PIPE
from subprocess import Popen
from tempfile import NamedTemporaryFile, mkdtemp

import glob
import os
import random
import string
from distutils.spawn import find_executable
from pyparsing import Literal, CaselessLiteral, oneOf, nums, Word, Combine, Optional, operatorPrecedence, opAssoc, \
from pyparsing import Literal, CaselessLiteral, oneOf, nums, Word, Combine, Optional, infixNotation, opAssoc, \
Forward, ParseException
from tempfile import NamedTemporaryFile, mkdtemp

import pygtftk

Expand Down Expand Up @@ -1214,9 +1214,9 @@ def check_boolean_exprs(exprs=None, operand=(), send_error=True):
group_1 = identifier + comparison_operator + value
group_2 = value + comparison_operator + identifier
comparison = group_1 | group_2
boolean_expr = operatorPrecedence(comparison,
[(and_operator, 2, opAssoc.LEFT),
(or_operator, 2, opAssoc.LEFT)])
boolean_expr = infixNotation(comparison,
[(and_operator, 2, opAssoc.LEFT),
(or_operator, 2, opAssoc.LEFT)])

boolean_expr_par = lparen + boolean_expr + rparen

Expand Down

0 comments on commit 9390ee5

Please sign in to comment.