File: module.py

package info (click to toggle)
dh-fortran 0.45
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 492 kB
  • sloc: f90: 5,686; perl: 531; python: 296; makefile: 79; sh: 7
file content (43 lines) | stat: -rw-r--r-- 979 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/python3
"""
Module file handling for Fortran

Copyright (C) 2025 Alastair McKinstry <mckinstry@debian.org>
Released under the GPL-3 Gnu Public License.
"""

import click
import logging
import magic

log = logging.getLogger("dhfortran")


@click.command()
@click.option("--sourcedir")
def dh_fortran_mod(*args, **argv):
    """Entry point for dh_fortran_mod command"""

    pass


def which_mod_version(modfile: str) -> str:
    """ """

    def parse_modfile(mf):
        try:
            magic = magic.from_file(modfile)
        except:
            raise Error(f"Can't open modfile {modfile}")
        mime = magic.split(";")[0]
        if (mime == "test/plain") or (mime == "text/x-c++"):
            with open(modfile) as mf:
                strings = mf.readstrings()
        else:
            if mime == "application/gzip":
                pass


def which_compiler(s: str) -> str:
    """Determine which compiler pkg(s) created a given mod/smod file"""
    pass